Skip to content

Commit

Permalink
merge fx-team to mozilla-central a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
BavarianTomcat committed Oct 21, 2016
2 parents 1dc892d + c6120f4 commit e990049
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 89 deletions.
22 changes: 11 additions & 11 deletions browser/components/preferences/in-content/privacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -651,22 +651,22 @@ var gPrivacyPane = {
* Displays a dialog from which individual parts of private data may be
* cleared.
*/
clearPrivateDataNow: function (aClearEverything)
{
clearPrivateDataNow: function (aClearEverything) {
var ts = document.getElementById("privacy.sanitize.timeSpan");
var timeSpanOrig = ts.value;
if (aClearEverything)

if (aClearEverything) {
ts.value = 0;
}

const Cc = Components.classes, Ci = Components.interfaces;
var glue = Cc["@mozilla.org/browser/browserglue;1"]
.getService(Ci.nsIBrowserGlue);
glue.sanitize(window);
gSubDialog.open("chrome://browser/content/sanitize.xul", "resizable=no", null, () => {
// reset the timeSpan pref
if (aClearEverything) {
ts.value = timeSpanOrig;
}

// reset the timeSpan pref
if (aClearEverything)
ts.value = timeSpanOrig;
Services.obs.notifyObservers(null, "clear-private-data", null);
Services.obs.notifyObservers(null, "clear-private-data", null);
});
},

/**
Expand Down
18 changes: 16 additions & 2 deletions browser/components/preferences/in-content/subdialogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,18 @@ var gSubDialog = {

this._frame.contentWindow.addEventListener("dialogclosing", this);

let oldResizeBy = this._frame.contentWindow.resizeBy;
this._frame.contentWindow.resizeBy = function(resizeByWidth, resizeByHeight) {
// Only handle resizeByHeight currently.
let frameHeight = gSubDialog._frame.clientHeight;
let boxMinHeight = parseFloat(getComputedStyle(gSubDialog._box).minHeight, 10);

gSubDialog._frame.style.height = (frameHeight + resizeByHeight) + "px";
gSubDialog._box.style.minHeight = (boxMinHeight + resizeByHeight) + "px";

oldResizeBy.call(gSubDialog._frame.contentWindow, resizeByWidth, resizeByHeight);
};

// Make window.close calls work like dialog closing.
let oldClose = this._frame.contentWindow.close;
this._frame.contentWindow.close = function() {
Expand Down Expand Up @@ -273,8 +285,10 @@ var gSubDialog = {
this._overlay.style.visibility = "visible";
this._overlay.style.opacity = ""; // XXX: focus hack continued from _onContentLoaded

this._resizeObserver = new MutationObserver(this._onResize);
this._resizeObserver.observe(this._box, {attributes: true});
if (this._box.getAttribute("resizable") == "true") {
this._resizeObserver = new MutationObserver(this._onResize);
this._resizeObserver.observe(this._box, {attributes: true});
}

this._trapFocus();
},
Expand Down
2 changes: 1 addition & 1 deletion browser/themes/linux/sanitizeDialog.css
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
padding: 0;
margin-top: 6px;
margin-bottom: 6px;
margin-inline-start: -6px;
margin-inline-start: -4px;
margin-inline-end: 0;
}

Expand Down
1 change: 0 additions & 1 deletion browser/themes/shared/incontentprefs/preferences.inc.css
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,6 @@ description > html|a {
#dialogFrame {
-moz-box-flex: 1;
/* Default dialog dimensions */
height: 20em;
width: 66ch;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ this.Preferences = {
["paneApplications", null],
["panePrivacy", null],
["panePrivacy", null, DNTDialog],
["panePrivacy", null, clearRecentHistoryDialog],
["paneSecurity", null],
["paneSync", null],
["paneAdvanced", "generalTab"],
Expand Down Expand Up @@ -107,6 +108,12 @@ function* connectionDialog(aBrowser) {
});
}

function* clearRecentHistoryDialog(aBrowser) {
yield ContentTask.spawn(aBrowser, null, function* () {
content.document.getElementById("historyRememberClear").click();
});
}

function* certManager(aBrowser) {
yield ContentTask.spawn(aBrowser, null, function* () {
content.document.getElementById("viewCertificatesButton").click();
Expand Down
10 changes: 10 additions & 0 deletions devtools/client/framework/toolbox-options.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@
</label>
</fieldset>

<fieldset id="debugger-options" class="options-groupbox">
<legend>&options.debugger.label;</legend>
<label title="&options.sourceMaps.tooltip;">
<input type="checkbox"
id="debugger-sourcemaps"
data-pref="devtools.debugger.client-source-maps-enabled"/>
<span>&options.sourceMaps.label;</span>
</label>
</fieldset>

<fieldset id="styleeditor-options" class="options-groupbox">
<legend>&options.styleeditor.label;</legend>
<label title="&options.stylesheetSourceMaps.tooltip;">
Expand Down
1 change: 1 addition & 0 deletions devtools/client/framework/toolbox-process-window.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ function setPrefDefaults() {
// Bug 1225160 - Using source maps with browser debugging can lead to a crash
Services.prefs.setBoolPref("devtools.debugger.source-maps-enabled", false);
Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
Services.prefs.setBoolPref("devtools.debugger.client-source-maps-enabled", true);
}

window.addEventListener("load", function() {
Expand Down
9 changes: 9 additions & 0 deletions devtools/client/locales/en-US/toolbox.dtd
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,15 @@
<!ENTITY options.timestampMessages.label "Enable timestamps">
<!ENTITY options.timestampMessages.tooltip "If you enable this option commands and output in the Web Console will display a timestamp">

<!-- LOCALIZATION NOTE (options.debugger.label): This is the label for the
- heading of the group of Debugger preferences in the options panel. -->
<!ENTITY options.debugger.label "Debugger">

<!-- LOCALIZATION NOTE (options.sourceMap.label): This is the
- label for the checkbox that toggles source maps in the Debugger -->
<!ENTITY options.sourceMaps.label "Enable Source Maps">
<!ENTITY options.sourceMaps.tooltip "If you enable this option sources will be mapped in the Debugger and Console.">

<!-- LOCALIZATION NOTE (options.styleeditor.label): This is the label for the
- heading of the group of Style Editor preferences in the options
- panel. -->
Expand Down
1 change: 1 addition & 0 deletions devtools/client/preferences/devtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ pref("devtools.debugger.remote-timeout", 20000);
pref("devtools.debugger.pause-on-exceptions", false);
pref("devtools.debugger.ignore-caught-exceptions", true);
pref("devtools.debugger.source-maps-enabled", true);
pref("devtools.debugger.client-source-maps-enabled", true);
pref("devtools.debugger.pretty-print-enabled", true);
pref("devtools.debugger.auto-pretty-print", false);
pref("devtools.debugger.auto-black-box", true);
Expand Down
40 changes: 0 additions & 40 deletions devtools/server/actors/highlighters/box-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@

"use strict";

const { Cu } = require("chrome");
const { extend } = require("sdk/core/heritage");
const { AutoRefreshHighlighter } = require("./auto-refresh");
const { CssGridHighlighter } = require("./css-grid");
const {
CanvasFrameAnonymousContentHelper,
createNode,
Expand All @@ -20,7 +18,6 @@ const {
const { setIgnoreLayoutChanges } = require("devtools/shared/layout/utils");
const inspector = require("devtools/server/actors/inspector");
const nodeConstants = require("devtools/shared/dom-node-constants");
const Services = require("Services");

// Note that the order of items in this array is important because it is used
// for drawing the BoxModelHighlighter's path elements correctly.
Expand All @@ -31,8 +28,6 @@ const GUIDE_STROKE_WIDTH = 1;
// FIXME: add ":visited" and ":link" after bug 713106 is fixed
const PSEUDO_CLASSES = [":hover", ":active", ":focus"];

const GRID_ENABLED_PREF = "layout.css.grid.enabled";

/**
* The BoxModelHighlighter draws the box model regions on top of a node.
* If the node is a block box, then each region will be displayed as 1 polygon.
Expand Down Expand Up @@ -97,10 +92,6 @@ const GRID_ENABLED_PREF = "layout.css.grid.enabled";
function BoxModelHighlighter(highlighterEnv) {
AutoRefreshHighlighter.call(this, highlighterEnv);

if (Services.prefs.getBoolPref(GRID_ENABLED_PREF)) {
this.cssGridHighlighter = new CssGridHighlighter(this.highlighterEnv);
}

this.markup = new CanvasFrameAnonymousContentHelper(this.highlighterEnv,
this._buildMarkup.bind(this));

Expand Down Expand Up @@ -263,11 +254,6 @@ BoxModelHighlighter.prototype = extend(AutoRefreshHighlighter.prototype, {
destroy: function () {
AutoRefreshHighlighter.prototype.destroy.call(this);
this.markup.destroy();

if (this.cssGridHighlighter) {
this.cssGridHighlighter.destroy();
this.cssGridHighlighter = null;
}
},

getElement: function (id) {
Expand All @@ -292,28 +278,6 @@ BoxModelHighlighter.prototype = extend(AutoRefreshHighlighter.prototype, {
this.options.region = "content";
}

// Show the CSS grid highlighter if the current node is a grid container or grid item.
if (this.cssGridHighlighter) {
this.cssGridHighlighter.hide();
let gridNode;
if (this.currentNode &&
this.currentNode.getGridFragments &&
this.currentNode.getGridFragments().length) {
gridNode = this.currentNode;
} else if (this.currentNode.parentNode &&
this.currentNode.parentNode.getGridFragments &&
this.currentNode.parentNode.getGridFragments().length) {
gridNode = this.currentNode.parentNode;
}

if (gridNode) {
// Display the grid highlighter for the grid container and
// hide the box model guides.
this.cssGridHighlighter.show(gridNode);
this.options.hideGuides = true;
}
}

let shown = this._update();
this._trackMutations();
this.emit("ready");
Expand Down Expand Up @@ -380,10 +344,6 @@ BoxModelHighlighter.prototype = extend(AutoRefreshHighlighter.prototype, {
this._hideBoxModel();
this._hideInfobar();

if (this.cssGridHighlighter) {
this.cssGridHighlighter.hide();
}

setIgnoreLayoutChanges(false, this.currentNode.ownerDocument.documentElement);
},

Expand Down
45 changes: 11 additions & 34 deletions devtools/server/actors/highlighters/css-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

"use strict";

const { Cu } = require("chrome");
const { extend } = require("sdk/core/heritage");
const { AutoRefreshHighlighter } = require("./auto-refresh");
const {
Expand Down Expand Up @@ -46,11 +45,7 @@ const GRID_GAP_PATTERN_STROKE_STYLE = "#9370DB";
/**
* Cached used by `CssGridHighlighter.getGridGapPattern`.
*/
const gCachedGridPattern = new WeakMap();
// WeakMap key for the Row grid pattern.
const ROW_KEY = {};
// WeakMap key for the Column grid pattern.
const COLUMN_KEY = {};
const gCachedGridPattern = new Map();

/**
* The CssGridHighlighter is the class that overlays a visual grid on top of
Expand Down Expand Up @@ -98,9 +93,6 @@ function CssGridHighlighter(highlighterEnv) {

this.markup = new CanvasFrameAnonymousContentHelper(this.highlighterEnv,
this._buildMarkup.bind(this));

this.onNavigate = this.onNavigate.bind(this);
this.highlighterEnv.on("navigate", this.onNavigate);
}

CssGridHighlighter.prototype = extend(AutoRefreshHighlighter.prototype, {
Expand Down Expand Up @@ -211,9 +203,9 @@ CssGridHighlighter.prototype = extend(AutoRefreshHighlighter.prototype, {
},

destroy() {
this.highlighterEnv.off("navigate", this.onNavigate);
this.markup.destroy();
AutoRefreshHighlighter.prototype.destroy.call(this);
this.markup.destroy();
gCachedGridPattern.clear();
},

getElement(id) {
Expand All @@ -231,14 +223,13 @@ CssGridHighlighter.prototype = extend(AutoRefreshHighlighter.prototype, {
/**
* Gets the grid gap pattern used to render the gap regions.
*
* @param {Object} dimension
* Refers to the WeakMap key for the grid dimension type which is either the
* constant COLUMN or ROW.
* @param {String} dimensionType
* The grid dimension type which is either the constant COLUMNS or ROWS.
* @return {CanvasPattern} grid gap pattern.
*/
getGridGapPattern(dimension) {
if (gCachedGridPattern.has(dimension)) {
return gCachedGridPattern.get(dimension);
getGridGapPattern(dimensionType) {
if (gCachedGridPattern.has(dimensionType)) {
return gCachedGridPattern.get(dimensionType);
}

// Create the diagonal lines pattern for the rendering the grid gaps.
Expand All @@ -251,7 +242,7 @@ CssGridHighlighter.prototype = extend(AutoRefreshHighlighter.prototype, {
ctx.beginPath();
ctx.translate(.5, .5);

if (dimension === COLUMN_KEY) {
if (dimensionType === COLUMNS) {
ctx.moveTo(0, 0);
ctx.lineTo(GRID_GAP_PATTERN_WIDTH, GRID_GAP_PATTERN_HEIGHT);
} else {
Expand All @@ -263,19 +254,10 @@ CssGridHighlighter.prototype = extend(AutoRefreshHighlighter.prototype, {
ctx.stroke();

let pattern = ctx.createPattern(canvas, "repeat");
gCachedGridPattern.set(dimension, pattern);
gCachedGridPattern.set(dimensionType, pattern);
return pattern;
},

/**
* Called when the page navigates. Used to clear the cached gap patterns and avoid
* using DeadWrapper objects as gap patterns the next time.
*/
onNavigate() {
gCachedGridPattern.delete(ROW_KEY);
gCachedGridPattern.delete(COLUMN_KEY);
},

_show() {
if (Services.prefs.getBoolPref(CSS_GRID_ENABLED_PREF) && !this.isGrid()) {
this.hide();
Expand Down Expand Up @@ -620,12 +602,11 @@ CssGridHighlighter.prototype = extend(AutoRefreshHighlighter.prototype, {
*/
renderGridGap(linePos, startPos, endPos, breadth, dimensionType) {
this.ctx.save();
this.ctx.fillStyle = this.getGridGapPattern(dimensionType);

if (dimensionType === COLUMNS) {
this.ctx.fillStyle = this.getGridGapPattern(COLUMN_KEY);
this.ctx.fillRect(linePos, startPos, breadth, endPos - startPos);
} else {
this.ctx.fillStyle = this.getGridGapPattern(ROW_KEY);
this.ctx.fillRect(startPos, linePos, endPos - startPos, breadth);
}

Expand Down Expand Up @@ -729,10 +710,6 @@ exports.CssGridHighlighter = CssGridHighlighter;
* @return {String} representation of the CSS grid fragment data.
*/
function stringifyGridFragments(fragments = []) {
if (fragments[0] && Cu.isDeadWrapper(fragments[0])) {
return {};
}

return JSON.stringify(fragments.map(getStringifiableFragment));
}

Expand Down

0 comments on commit e990049

Please sign in to comment.