Skip to content

Commit

Permalink
Merge inbound to mozilla-central. a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
shindli committed Jun 6, 2019
2 parents a06e4d2 + f169f9c commit 3caa33a
Show file tree
Hide file tree
Showing 1,652 changed files with 30,203 additions and 15,638 deletions.
1 change: 0 additions & 1 deletion browser/components/extensions/parent/ext-tabs.js
Expand Up @@ -1163,7 +1163,6 @@ this.tabs = class extends ExtensionAPI {
printSettings.printSilent = true;
printSettings.showPrintProgress = false;

printSettings.printFrameType = Ci.nsIPrintSettings.kFramesAsIs;
printSettings.outputFormat = Ci.nsIPrintSettings.kOutputFormatPDF;

if (pageSettings.paperSizeUnit !== null) {
Expand Down
14 changes: 13 additions & 1 deletion devtools/client/inspector/grids/grid-inspector.js
Expand Up @@ -346,6 +346,10 @@ class GridInspector {
return;
}

if (!parentGridNodeFront) {
return;
}

const parentIndex = grids.findIndex(g =>
g.nodeFront.actorID === parentGridNodeFront.actorID);
gridData.parentNodeActorID = parentGridNodeFront.actorID;
Expand Down Expand Up @@ -504,10 +508,18 @@ class GridInspector {
customGridColors[hostname][grid.id] = color;
await asyncStorage.setItem("gridInspectorHostColors", customGridColors);

if (!this.isPanelVisible()) {
// This call might fail if called asynchrously after the toolbox is finished
// closing.
return;
}

// If the grid for which the color was updated currently has a highlighter, update
// the color.
if (grid.highlighted) {
if (this.highlighters.gridHighlighters.has(node)) {
this.highlighters.showGridHighlighter(node);
} else if (this.highlighters.parentGridHighlighters.has(node)) {
this.highlighters.showParentGridHighlighter(node);
}
}
}
Expand Down
Expand Up @@ -25,28 +25,62 @@ add_task(async function() {
"Got the correct number of subgrids in div.container");
is(getGridItemElements(mainSubgridListEl).length, 2,
"Got the correct number of subgrids in main.subgrid");
ok(!highlighters.gridHighlighters.size, "No CSS grid highlighter is shown.");
ok(!highlighters.gridHighlighters.size && !highlighters.parentGridHighlighters.size,
"No CSS grid highlighter is shown.");

info("Toggling ON the CSS grid highlighter from the layout panel.");
const onHighlighterShown = highlighters.once("grid-highlighter-shown");
info("Toggling ON the CSS grid highlighter for header.");
let onHighlighterShown = highlighters.once("grid-highlighter-shown");
let onCheckboxChange = waitUntilState(store, state => state.grids[1].highlighted);
const checkbox = containerSubgridListEl.children[0].querySelector("input");
let checkbox = containerSubgridListEl.children[0].querySelector("input");
checkbox.click();
await onHighlighterShown;
await onCheckboxChange;

info("Checking the CSS grid highlighter is created.");
info("Checking the CSS grid highlighter and parent grid highlighter are created.");
is(highlighters.gridHighlighters.size, 1, "CSS grid highlighter is shown.");
is(highlighters.parentGridHighlighters.size, 1,
"CSS grid highlighter for parent grid container is shown.");

info("Toggling OFF the CSS grid highlighter from the layout panel.");
const onHighlighterHidden = highlighters.once("grid-highlighter-hidden");
info("Toggling ON the CSS grid highlighter for main.");
onHighlighterShown = highlighters.once("grid-highlighter-shown");
onCheckboxChange = waitUntilState(store, state =>
state.grids[1].highlighted && state.grids[2].highlighted);
checkbox = containerSubgridListEl.children[1].querySelector("input");
checkbox.click();
await onHighlighterShown;
await onCheckboxChange;

info("Checking the number of CSS grid highlighters present.");
is(highlighters.gridHighlighters.size, 2,
"Got the correct number of CSS grid highlighter shown.");
is(highlighters.parentGridHighlighters.size, 1,
"Only 1 parent grid highlighter should be shown for the same subgrid parent.");

info("Toggling OFF the CSS grid highlighter for main.");
let onHighlighterHidden = highlighters.once("grid-highlighter-hidden");
onCheckboxChange = waitUntilState(store, state =>
state.grids[1].highlighted && !state.grids[2].highlighted);
checkbox.click();
await onHighlighterHidden;
await onCheckboxChange;

info("Checking the number of CSS grid highlighters present.");
is(highlighters.gridHighlighters.size, 1,
"Got the correct number of CSS grid highlighter shown.");
is(highlighters.parentGridHighlighters.size, 1,
"Got the correct number of CSS grid parent highlighter shown.");

info("Toggling OFF the CSS grid highlighter for header.");
onHighlighterHidden = highlighters.once("grid-highlighter-hidden");
onCheckboxChange = waitUntilState(store, state => !state.grids[1].highlighted);
checkbox = containerSubgridListEl.children[0].querySelector("input");
checkbox.click();
await onHighlighterHidden;
await onCheckboxChange;

info("Checking the CSS grid highlighter is not shown.");
ok(!highlighters.gridHighlighters.size, "No CSS grid highlighter is shown.");
ok(!highlighters.gridHighlighters.size && !highlighters.parentGridHighlighters.size,
"No CSS grid highlighter is shown.");
});

/**
Expand Down
13 changes: 7 additions & 6 deletions devtools/client/inspector/markup/views/text-editor.js
Expand Up @@ -32,7 +32,6 @@ function TextEditor(container, node, type) {
this.showTextEditor = this.showTextEditor.bind(this);

this.buildMarkup(type);
this.update();
}

TextEditor.prototype = {
Expand All @@ -42,11 +41,13 @@ TextEditor.prototype = {
this.elt = doc.createElement("span");
this.elt.classList.add("editor", type);

this.textNode = this.ReactDOM.render(TextNode({
showTextEditor: this.showTextEditor,
type,
value: "",
}), this.elt);
getLongString(this.node.getNodeValue()).then(value => {
this.textNode = this.ReactDOM.render(TextNode({
showTextEditor: this.showTextEditor,
type,
value,
}), this.elt);
});
},

get ReactDOM() {
Expand Down

0 comments on commit 3caa33a

Please sign in to comment.