Merge mozilla-central to mozilla-inbound
|
@ -19,7 +19,7 @@
|
|||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="61cd07a8b5fa017777db6d345e00afb4fb8789b7"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="dd9e74d196675b0b05170f0ab94a80a36697a551"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="531cf670e485649c69746e46d567929fcd54cbc5"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="8e4420c0c5c8e8c8e58a000278a7129403769f96"/>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="61cd07a8b5fa017777db6d345e00afb4fb8789b7"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="dd9e74d196675b0b05170f0ab94a80a36697a551"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="531cf670e485649c69746e46d567929fcd54cbc5"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="600ef6ddc915ceffc1a89d51b7be8453fe709992"/>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<project name="platform_build" path="build" remote="b2g" revision="276ce45e78b09c4a4ee643646f691d22804754c1">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="61cd07a8b5fa017777db6d345e00afb4fb8789b7"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="dd9e74d196675b0b05170f0ab94a80a36697a551"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="531cf670e485649c69746e46d567929fcd54cbc5"/>
|
||||
<project name="librecovery" patch="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="61cd07a8b5fa017777db6d345e00afb4fb8789b7"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="dd9e74d196675b0b05170f0ab94a80a36697a551"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="531cf670e485649c69746e46d567929fcd54cbc5"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="8e4420c0c5c8e8c8e58a000278a7129403769f96"/>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
</project>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="61cd07a8b5fa017777db6d345e00afb4fb8789b7"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="dd9e74d196675b0b05170f0ab94a80a36697a551"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="531cf670e485649c69746e46d567929fcd54cbc5"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="600ef6ddc915ceffc1a89d51b7be8453fe709992"/>
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
"remote": "",
|
||||
"branch": ""
|
||||
},
|
||||
"revision": "fe1d2cacb28a6876729ebb4315432c9cce2eb797",
|
||||
"revision": "d69102eda2275b178a4b5c2916522fb82feb05f5",
|
||||
"repo_path": "/integration/gaia-central"
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="61cd07a8b5fa017777db6d345e00afb4fb8789b7"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="dd9e74d196675b0b05170f0ab94a80a36697a551"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="531cf670e485649c69746e46d567929fcd54cbc5"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="61cd07a8b5fa017777db6d345e00afb4fb8789b7"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="dd9e74d196675b0b05170f0ab94a80a36697a551"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="531cf670e485649c69746e46d567929fcd54cbc5"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="61cd07a8b5fa017777db6d345e00afb4fb8789b7"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="dd9e74d196675b0b05170f0ab94a80a36697a551"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="531cf670e485649c69746e46d567929fcd54cbc5"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="600ef6ddc915ceffc1a89d51b7be8453fe709992"/>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="61cd07a8b5fa017777db6d345e00afb4fb8789b7"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="dd9e74d196675b0b05170f0ab94a80a36697a551"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="531cf670e485649c69746e46d567929fcd54cbc5"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
|
|
@ -2,10 +2,15 @@
|
|||
skip-if = e10s # Bug ?????? - devtools tests disabled with e10s
|
||||
subsuite = devtools
|
||||
support-files =
|
||||
doc_layoutview_iframe1.html
|
||||
doc_layoutview_iframe2.html
|
||||
head.js
|
||||
|
||||
[browser_layoutview.js]
|
||||
[browser_layoutview_rotate-labels-on-sides.js]
|
||||
[browser_layoutview_update-after-navigation.js]
|
||||
[browser_layoutview_update-after-reload.js]
|
||||
[browser_layoutview_update-in-iframes.js]
|
||||
[browser_editablemodel.js]
|
||||
[browser_editablemodel_allproperties.js]
|
||||
[browser_editablemodel_border.js]
|
||||
|
|
|
@ -0,0 +1,99 @@
|
|||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
// Test that the layout-view continues to work after a page navigation and that
|
||||
// it also works after going back
|
||||
|
||||
let test = asyncTest(function*() {
|
||||
yield addTab(TEST_URL_ROOT + "doc_layoutview_iframe1.html");
|
||||
let {toolbox, inspector, view} = yield openLayoutView();
|
||||
yield runTests(inspector, view);
|
||||
yield destroyToolbox(inspector);
|
||||
});
|
||||
|
||||
addTest("Test that the layout-view works on the first page",
|
||||
function*(inspector, view) {
|
||||
info("Selecting the test node");
|
||||
yield selectNode("p", inspector);
|
||||
|
||||
info("Checking that the layout-view shows the right value");
|
||||
let paddingElt = view.doc.querySelector(".padding.top > span");
|
||||
is(paddingElt.textContent, "50");
|
||||
|
||||
info("Listening for layout-view changes and modifying the padding");
|
||||
let onUpdated = waitForUpdate(inspector);
|
||||
getNode("p").style.padding = "20px";
|
||||
yield onUpdated;
|
||||
ok(true, "Layout-view got updated");
|
||||
|
||||
info("Checking that the layout-view shows the right value after update");
|
||||
is(paddingElt.textContent, "20");
|
||||
});
|
||||
|
||||
addTest("Navigate to the second page",
|
||||
function*(inspector, view) {
|
||||
yield navigateTo(TEST_URL_ROOT + "doc_layoutview_iframe2.html");
|
||||
yield inspector.once("markuploaded");
|
||||
});
|
||||
|
||||
addTest("Test that the layout-view works on the second page",
|
||||
function*(inspector, view) {
|
||||
info("Selecting the test node");
|
||||
yield selectNode("p", inspector);
|
||||
|
||||
info("Checking that the layout-view shows the right value");
|
||||
let sizeElt = view.doc.querySelector(".size > span");
|
||||
is(sizeElt.textContent, "100x100");
|
||||
|
||||
info("Listening for layout-view changes and modifying the size");
|
||||
let onUpdated = waitForUpdate(inspector);
|
||||
getNode("p").style.width = "200px";
|
||||
yield onUpdated;
|
||||
ok(true, "Layout-view got updated");
|
||||
|
||||
info("Checking that the layout-view shows the right value after update");
|
||||
is(sizeElt.textContent, "200x100");
|
||||
});
|
||||
|
||||
addTest("Go back to the first page",
|
||||
function*(inspector, view) {
|
||||
content.history.back();
|
||||
yield inspector.once("markuploaded");
|
||||
});
|
||||
|
||||
addTest("Test that the layout-view works on the first page after going back",
|
||||
function*(inspector, view) {
|
||||
info("Selecting the test node");
|
||||
yield selectNode("p", inspector);
|
||||
|
||||
info("Checking that the layout-view shows the right value, which is the" +
|
||||
"modified value from step one because of the bfcache");
|
||||
let paddingElt = view.doc.querySelector(".padding.top > span");
|
||||
is(paddingElt.textContent, "20");
|
||||
|
||||
info("Listening for layout-view changes and modifying the padding");
|
||||
let onUpdated = waitForUpdate(inspector);
|
||||
getNode("p").style.padding = "100px";
|
||||
yield onUpdated;
|
||||
ok(true, "Layout-view got updated");
|
||||
|
||||
info("Checking that the layout-view shows the right value after update");
|
||||
is(paddingElt.textContent, "100");
|
||||
});
|
||||
|
||||
function navigateTo(url) {
|
||||
info("Navigating to " + url);
|
||||
|
||||
let def = promise.defer();
|
||||
gBrowser.selectedBrowser.addEventListener("load", function onload() {
|
||||
gBrowser.selectedBrowser.removeEventListener("load", onload, true);
|
||||
info("URL " + url + " loading complete");
|
||||
waitForFocus(def.resolve, content);
|
||||
}, true);
|
||||
content.location = url;
|
||||
|
||||
return def.promise;
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
// Test that the layout-view continues to work after the page is reloaded
|
||||
|
||||
let test = asyncTest(function*() {
|
||||
yield addTab(TEST_URL_ROOT + "doc_layoutview_iframe1.html");
|
||||
let {toolbox, inspector, view} = yield openLayoutView();
|
||||
|
||||
info("Test that the layout-view works on the first page");
|
||||
yield assertLayoutView(inspector, view);
|
||||
|
||||
info("Reload the page");
|
||||
content.location.reload();
|
||||
yield inspector.once("markuploaded");
|
||||
|
||||
info("Test that the layout-view works on the reloaded page");
|
||||
yield assertLayoutView(inspector, view);
|
||||
|
||||
yield destroyToolbox(inspector);
|
||||
});
|
||||
|
||||
function* assertLayoutView(inspector, view) {
|
||||
info("Selecting the test node");
|
||||
yield selectNode("p", inspector);
|
||||
|
||||
info("Checking that the layout-view shows the right value");
|
||||
let paddingElt = view.doc.querySelector(".padding.top > span");
|
||||
is(paddingElt.textContent, "50");
|
||||
|
||||
info("Listening for layout-view changes and modifying the padding");
|
||||
let onUpdated = waitForUpdate(inspector);
|
||||
getNode("p").style.padding = "20px";
|
||||
yield onUpdated;
|
||||
ok(true, "Layout-view got updated");
|
||||
|
||||
info("Checking that the layout-view shows the right value after update");
|
||||
is(paddingElt.textContent, "20");
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
// Test that the layout-view for elements within iframes also updates when they
|
||||
// change
|
||||
|
||||
let test = asyncTest(function*() {
|
||||
yield addTab(TEST_URL_ROOT + "doc_layoutview_iframe1.html");
|
||||
let iframe2 = getNode("iframe").contentDocument.querySelector("iframe");
|
||||
|
||||
let {toolbox, inspector, view} = yield openLayoutView();
|
||||
yield runTests(inspector, view, iframe2);
|
||||
yield destroyToolbox(inspector);
|
||||
});
|
||||
|
||||
addTest("Test that resizing an element in an iframe updates its box model",
|
||||
function*(inspector, view, iframe2) {
|
||||
info("Selecting the nested test node");
|
||||
let node = iframe2.contentDocument.querySelector("div");
|
||||
yield selectNode(node, inspector);
|
||||
|
||||
info("Checking that the layout-view shows the right value");
|
||||
let sizeElt = view.doc.querySelector(".size > span");
|
||||
is(sizeElt.textContent, "400x200");
|
||||
|
||||
info("Listening for layout-view changes and modifying its size");
|
||||
let onUpdated = waitForUpdate(inspector);
|
||||
node.style.width = "200px";
|
||||
yield onUpdated;
|
||||
ok(true, "Layout-view got updated");
|
||||
|
||||
info("Checking that the layout-view shows the right value after update");
|
||||
is(sizeElt.textContent, "200x200");
|
||||
});
|
||||
|
||||
addTest("Test reflows are still sent to the layout-view after deleting an iframe",
|
||||
function*(inspector, view, iframe2) {
|
||||
info("Deleting the iframe2");
|
||||
iframe2.remove();
|
||||
yield inspector.once("inspector-updated");
|
||||
|
||||
info("Selecting the test node in iframe1");
|
||||
let node = getNode("iframe").contentDocument.querySelector("p");
|
||||
yield selectNode(node, inspector);
|
||||
|
||||
info("Checking that the layout-view shows the right value");
|
||||
let sizeElt = view.doc.querySelector(".size > span");
|
||||
is(sizeElt.textContent, "100x100");
|
||||
|
||||
info("Listening for layout-view changes and modifying its size");
|
||||
let onUpdated = waitForUpdate(inspector);
|
||||
node.style.width = "200px";
|
||||
yield onUpdated;
|
||||
ok(true, "Layout-view got updated");
|
||||
|
||||
info("Checking that the layout-view shows the right value after update");
|
||||
is(sizeElt.textContent, "200x100");
|
||||
});
|
|
@ -0,0 +1,3 @@
|
|||
<!DOCTYPE html>
|
||||
<p style="padding:50px;color:#f06;">Root page</p>
|
||||
<iframe src="doc_layoutview_iframe2.html"></iframe>
|
|
@ -0,0 +1,3 @@
|
|||
<!DOCTYPE html>
|
||||
<p style="width:100px;height:100px;background:red;">iframe 1</p>
|
||||
<iframe src="data:text/html,<div style='width:400px;height:200px;background:yellow;'>iframe 2</div>"></iframe>
|
|
@ -23,6 +23,7 @@ support-files = head.js
|
|||
[browser_scratchpad_falsy.js]
|
||||
[browser_scratchpad_edit_ui_updates.js]
|
||||
[browser_scratchpad_revert_to_saved.js]
|
||||
[browser_scratchpad_run_error_goto_line.js]
|
||||
[browser_scratchpad_contexts.js]
|
||||
[browser_scratchpad_execute_print.js]
|
||||
[browser_scratchpad_files.js]
|
||||
|
@ -34,6 +35,7 @@ support-files = head.js
|
|||
[browser_scratchpad_throw_output.js]
|
||||
[browser_scratchpad_pprint-02.js]
|
||||
[browser_scratchpad_pprint.js]
|
||||
[browser_scratchpad_pprint_error_goto_line.js]
|
||||
[browser_scratchpad_restore.js]
|
||||
[browser_scratchpad_tab_switch.js]
|
||||
[browser_scratchpad_ui.js]
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
/* -*- Mode: js; tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2; fill-column: 80 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
gBrowser.selectedBrowser.addEventListener("load", function onLoad() {
|
||||
gBrowser.selectedBrowser.removeEventListener("load", onLoad, true);
|
||||
openScratchpad(runTests);
|
||||
}, true);
|
||||
|
||||
content.location = "data:text/html;charset=utf8,test Scratchpad pretty print error goto line.";
|
||||
}
|
||||
|
||||
function testJumpToPrettyPrintError(sp, error, remark) {
|
||||
info("will test jumpToLine after prettyPrint error" + remark);
|
||||
// CodeMirror lines and columns are 0-based, Scratchpad UI and error
|
||||
// stack are 1-based.
|
||||
is(/Invalid regexp flag \(3:10\)/.test(error), true, "prettyPrint expects error in editor text:\n" + error);
|
||||
const errorLine = 3, errorColumn = 10;
|
||||
const editorDoc = sp.editor.container.contentDocument;
|
||||
sp.editor.jumpToLine();
|
||||
const lineInput = editorDoc.querySelector("input");
|
||||
const errorLocation = lineInput.value;
|
||||
const [ inputLine, inputColumn ] = errorLocation.split(":");
|
||||
is(inputLine, errorLine, "jumpToLine input field is set from editor selection (line)");
|
||||
is(inputColumn, errorColumn, "jumpToLine input field is set from editor selection (column)");
|
||||
EventUtils.synthesizeKey("VK_RETURN", { }, editorDoc.defaultView);
|
||||
// CodeMirror lines and columns are 0-based, Scratchpad UI and error
|
||||
// stack are 1-based.
|
||||
const cursor = sp.editor.getCursor();
|
||||
is(inputLine, cursor.line + 1, "jumpToLine goto error location (line)");
|
||||
is(inputColumn, cursor.ch + 1, "jumpToLine goto error location (column)");
|
||||
}
|
||||
|
||||
function runTests(sw, sp)
|
||||
{
|
||||
sp.setText([
|
||||
"// line 1",
|
||||
"// line 2",
|
||||
"var re = /a bad /regexp/; // line 3 is an obvious syntax error!",
|
||||
"// line 4",
|
||||
"// line 5",
|
||||
""
|
||||
].join("\n"));
|
||||
sp.prettyPrint().then(aFulfill => {
|
||||
ok(false, "Expecting Invalid regexp flag (3:10)");
|
||||
finish();
|
||||
}, error => {
|
||||
testJumpToPrettyPrintError(sp, error, " (Bug 1005471, first time)");
|
||||
});
|
||||
sp.prettyPrint().then(aFulfill => {
|
||||
ok(false, "Expecting Invalid regexp flag (3:10)");
|
||||
finish();
|
||||
}, error => {
|
||||
// Second time verifies bug in earlier implementation fixed.
|
||||
testJumpToPrettyPrintError(sp, error, " (second time)");
|
||||
finish();
|
||||
});
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
/* -*- Mode: js; tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2; fill-column: 80 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
gBrowser.selectedBrowser.addEventListener("load", function onLoad() {
|
||||
gBrowser.selectedBrowser.removeEventListener("load", onLoad, true);
|
||||
openScratchpad(runTests);
|
||||
}, true);
|
||||
|
||||
content.location = "data:text/html;charset=utf8,test Scratchpad pretty print.";
|
||||
}
|
||||
|
||||
function runTests(sw)
|
||||
{
|
||||
const sp = sw.Scratchpad;
|
||||
sp.setText([
|
||||
"// line 1",
|
||||
"// line 2",
|
||||
"var re = /a bad /regexp/; // line 3 is an obvious syntax error!",
|
||||
"// line 4",
|
||||
"// line 5",
|
||||
""
|
||||
].join("\n"));
|
||||
sp.run().then(() => {
|
||||
// CodeMirror lines and columns are 0-based, Scratchpad UI and error
|
||||
// stack are 1-based.
|
||||
let errorLine = 3;
|
||||
let editorDoc = sp.editor.container.contentDocument;
|
||||
sp.editor.jumpToLine();
|
||||
let lineInput = editorDoc.querySelector("input");
|
||||
let inputLine = lineInput.value;
|
||||
is(inputLine, errorLine, "jumpToLine input field is set from editor selection");
|
||||
EventUtils.synthesizeKey("VK_RETURN", { }, editorDoc.defaultView);
|
||||
// CodeMirror lines and columns are 0-based, Scratchpad UI and error
|
||||
// stack are 1-based.
|
||||
let cursor = sp.editor.getCursor();
|
||||
is(cursor.line + 1, inputLine, "jumpToLine goto error location (line)");
|
||||
is(cursor.ch + 1, 1, "jumpToLine goto error location (column)");
|
||||
finish();
|
||||
});
|
||||
}
|
|
@ -1,3 +1,4 @@
|
|||
/* -*- Mode: js; tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2; fill-column: 80 -*- */
|
||||
/* vim:set ts=2 sw=2 sts=2 et tw=80:
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
@ -20,6 +21,11 @@ const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.x
|
|||
// while shifting to a line which was initially out of view.
|
||||
const MAX_VERTICAL_OFFSET = 3;
|
||||
|
||||
// Match @Scratchpad/N:LINE[:COLUMN] or (LINE[:COLUMN]) anywhere at an end of
|
||||
// line in text selection.
|
||||
const RE_SCRATCHPAD_ERROR = /(?:@Scratchpad\/\d+:|\()(\d+):?(\d+)?(?:\)|\n)/;
|
||||
const RE_JUMP_TO_LINE = /^(\d+):?(\d+)?/;
|
||||
|
||||
const {Promise: promise} = Cu.import("resource://gre/modules/Promise.jsm", {});
|
||||
const events = require("devtools/toolkit/event-emitter");
|
||||
|
||||
|
@ -752,7 +758,28 @@ Editor.prototype = {
|
|||
div.appendChild(txt);
|
||||
div.appendChild(inp);
|
||||
|
||||
this.openDialog(div, (line) => this.setCursor({ line: line - 1, ch: 0 }));
|
||||
if (!this.hasMultipleSelections()) {
|
||||
let cm = editors.get(this);
|
||||
let sel = cm.getSelection();
|
||||
// Scratchpad inserts and selects a comment after an error happens:
|
||||
// "@Scratchpad/1:10:2". Parse this to get the line and column.
|
||||
// In the string above this is line 10, column 2.
|
||||
let match = sel.match(RE_SCRATCHPAD_ERROR);
|
||||
if (match) {
|
||||
let [ , line, column ] = match;
|
||||
inp.value = column ? line + ":" + column : line;
|
||||
inp.selectionStart = inp.selectionEnd = inp.value.length;
|
||||
}
|
||||
}
|
||||
|
||||
this.openDialog(div, (line) => {
|
||||
// Handle LINE:COLUMN as well as LINE
|
||||
let match = line.toString().match(RE_JUMP_TO_LINE);
|
||||
if (match) {
|
||||
let [ , line, column ] = match;
|
||||
this.setCursor({line: line - 1, ch: column ? column - 1 : 0 });
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -22,6 +22,7 @@ support-files =
|
|||
|
||||
[browser_editor_basic.js]
|
||||
[browser_editor_cursor.js]
|
||||
[browser_editor_goto_line.js]
|
||||
[browser_editor_history.js]
|
||||
[browser_editor_markers.js]
|
||||
[browser_editor_movelines.js]
|
||||
|
|
|
@ -0,0 +1,130 @@
|
|||
/* -*- Mode: js; tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2; fill-column: 80 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
function testJumpToLine (ed, inputLine, expectCursor) {
|
||||
ed.jumpToLine();
|
||||
let editorDoc = ed.container.contentDocument;
|
||||
let lineInput = editorDoc.querySelector("input");
|
||||
lineInput.value = inputLine;
|
||||
EventUtils.synthesizeKey("VK_RETURN", { }, editorDoc.defaultView);
|
||||
// CodeMirror lines and columns are 0-based, Scratchpad UI is 1-based.
|
||||
ch(ed.getCursor(), expectCursor, "jumpToLine " + inputLine + " expects cursor " + expectCursor.toSource());
|
||||
}
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
setup((ed, win) => {
|
||||
let textLines = [
|
||||
"// line 1",
|
||||
"// line 2",
|
||||
"// line 3",
|
||||
"// line 4",
|
||||
"// line 5",
|
||||
""];
|
||||
ed.setText(textLines.join("\n"));
|
||||
waitForFocus(function () {
|
||||
let testVectors = [
|
||||
// Various useless inputs go to line 0, column 0 or do nothing.
|
||||
["",
|
||||
{line:0, ch:0}],
|
||||
[":",
|
||||
{line:0, ch:0}],
|
||||
[" ",
|
||||
{line:0, ch:0}],
|
||||
[" : ",
|
||||
{line:0, ch:0}],
|
||||
["a:b",
|
||||
{line:0, ch:0}],
|
||||
["LINE:COLUMN",
|
||||
{line:0, ch:0}],
|
||||
["-1",
|
||||
{line:0, ch:0}],
|
||||
[":-1",
|
||||
{line:0, ch:0}],
|
||||
["-1:-1",
|
||||
{line:0, ch:0}],
|
||||
["0",
|
||||
{line:0, ch:0}],
|
||||
[":0",
|
||||
{line:0, ch:0}],
|
||||
["0:0",
|
||||
{line:0, ch:0}],
|
||||
// Starting here expect data needs to get updated for length changes to
|
||||
// "textLines" above.
|
||||
// Just jump to line
|
||||
["1",
|
||||
{line:0, ch:0}],
|
||||
// Jump to second character in line
|
||||
["1:2",
|
||||
{line:0, ch:1}],
|
||||
// Jump to last character on line
|
||||
["1:9",
|
||||
{line:0, ch:8}],
|
||||
// Jump just after last character on line (end of line)
|
||||
["1:10",
|
||||
{line:0, ch:9}],
|
||||
// Jump one character past end of line (gets clamped to end of line)
|
||||
["1:11",
|
||||
{line:0, ch:9}],
|
||||
["2",
|
||||
{line:1, ch:0}],
|
||||
["2:2",
|
||||
{line:1, ch:1}],
|
||||
["2:10",
|
||||
{line:1, ch:9}],
|
||||
["2:11",
|
||||
{line:1, ch:10}],
|
||||
["2:12",
|
||||
{line:1, ch:10}],
|
||||
["3",
|
||||
{line:2, ch:0}],
|
||||
["3:2",
|
||||
{line:2, ch:1}],
|
||||
["3:11",
|
||||
{line:2, ch:10}],
|
||||
["3:12",
|
||||
{line:2, ch:11}],
|
||||
["3:13",
|
||||
{line:2, ch:11}],
|
||||
["4",
|
||||
{line:3, ch:0}],
|
||||
["4:2",
|
||||
{line:3, ch:1}],
|
||||
["4:12",
|
||||
{line:3, ch:11}],
|
||||
["4:13",
|
||||
{line:3, ch:12}],
|
||||
["4:14",
|
||||
{line:3, ch:12}],
|
||||
["5",
|
||||
{line:4, ch:0}],
|
||||
["5:2",
|
||||
{line:4, ch:1}],
|
||||
["5:13",
|
||||
{line:4, ch:12}],
|
||||
["5:14",
|
||||
{line:4, ch:13}],
|
||||
["5:15",
|
||||
{line:4, ch:13}],
|
||||
// One line beyond last newline in editor text:
|
||||
["6",
|
||||
{line:5, ch:0}],
|
||||
["6:2",
|
||||
{line:5, ch:0}],
|
||||
// Two line beyond last newline in editor text (gets clamped):
|
||||
["7",
|
||||
{line:5, ch:0}],
|
||||
["7:2",
|
||||
{line:5, ch:0}]
|
||||
];
|
||||
testVectors.forEach(function (vector) {
|
||||
testJumpToLine(ed, vector[0], vector[1]);
|
||||
});
|
||||
teardown(ed, win);
|
||||
});
|
||||
});
|
||||
}
|
|
@ -5,53 +5,47 @@
|
|||
// This test makes sure that the style editor does not store any
|
||||
// content CSS files in the permanent cache when opened from PB mode.
|
||||
|
||||
let gUI;
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
let windowsToClose = [];
|
||||
let gUI;
|
||||
let testURI = 'http://' + TEST_HOST + '/browser/browser/devtools/styleeditor/test/test_private.html';
|
||||
|
||||
function checkCache() {
|
||||
checkDiskCacheFor(TEST_HOST, function() {
|
||||
gUI = null;
|
||||
finish();
|
||||
});
|
||||
}
|
||||
info("Opening a new private window");
|
||||
let win = OpenBrowserWindow({private: true});
|
||||
win.addEventListener("load", function onLoad() {
|
||||
win.removeEventListener("load", onLoad, false);
|
||||
executeSoon(startTest);
|
||||
}, false);
|
||||
|
||||
function doTest(aWindow) {
|
||||
aWindow.gBrowser.selectedBrowser.addEventListener("load", function onLoad() {
|
||||
aWindow.gBrowser.selectedBrowser.removeEventListener("load", onLoad, true);
|
||||
function startTest() {
|
||||
win.gBrowser.selectedBrowser.addEventListener("load", function onLoad() {
|
||||
win.gBrowser.selectedBrowser.removeEventListener("load", onLoad, true);
|
||||
|
||||
info("Clearing the browser cache");
|
||||
cache.clear();
|
||||
openStyleEditorInWindow(aWindow, function(panel) {
|
||||
|
||||
info("Opening the style editor in the private window");
|
||||
openStyleEditorInWindow(win, function(panel) {
|
||||
gUI = panel.UI;
|
||||
gUI.on("editor-added", onEditorAdded);
|
||||
});
|
||||
}, true);
|
||||
|
||||
aWindow.gBrowser.selectedBrowser.loadURI(testURI);
|
||||
info("Loading the test URL in the new private window");
|
||||
win.content.location = testURI;
|
||||
}
|
||||
|
||||
function onEditorAdded(aEvent, aEditor) {
|
||||
info("The style editor is ready")
|
||||
aEditor.getSourceEditor().then(checkCache);
|
||||
}
|
||||
|
||||
function testOnWindow(options, callback) {
|
||||
let win = OpenBrowserWindow(options);
|
||||
win.addEventListener("load", function onLoad() {
|
||||
win.removeEventListener("load", onLoad, false);
|
||||
windowsToClose.push(win);
|
||||
executeSoon(function() callback(win));
|
||||
}, false);
|
||||
};
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
windowsToClose.forEach(function(win) {
|
||||
function checkCache() {
|
||||
checkDiskCacheFor(TEST_HOST, function() {
|
||||
win.close();
|
||||
win = null;
|
||||
gUI = null;
|
||||
finish();
|
||||
});
|
||||
});
|
||||
|
||||
testOnWindow({private: true}, function(win) {
|
||||
doTest(win);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -272,10 +272,18 @@ browser.jar:
|
|||
skin/classic/browser/devtools/debugger-toggleBreakpoints@2x.png (../shared/devtools/images/debugger-toggleBreakpoints@2x.png)
|
||||
skin/classic/browser/devtools/tracer-icon.png (../shared/devtools/images/tracer-icon.png)
|
||||
skin/classic/browser/devtools/tracer-icon@2x.png (../shared/devtools/images/tracer-icon@2x.png)
|
||||
skin/classic/browser/devtools/responsive-se-resizer.png (../shared/devtools/images/responsive-se-resizer.png)
|
||||
skin/classic/browser/devtools/responsive-vertical-resizer.png (../shared/devtools/images/responsive-vertical-resizer.png)
|
||||
skin/classic/browser/devtools/responsive-horizontal-resizer.png (../shared/devtools/images/responsive-horizontal-resizer.png)
|
||||
skin/classic/browser/devtools/responsive-background.png (../shared/devtools/images/responsive-background.png)
|
||||
skin/classic/browser/devtools/responsive-se-resizer.png (../shared/devtools/images/responsivemode/responsive-se-resizer.png)
|
||||
skin/classic/browser/devtools/responsive-se-resizer@2x.png (../shared/devtools/images/responsivemode/responsive-se-resizer@2x.png)
|
||||
skin/classic/browser/devtools/responsive-vertical-resizer.png (../shared/devtools/images/responsivemode/responsive-vertical-resizer.png)
|
||||
skin/classic/browser/devtools/responsive-vertical-resizer@2x.png (../shared/devtools/images/responsivemode/responsive-vertical-resizer@2x.png)
|
||||
skin/classic/browser/devtools/responsive-horizontal-resizer.png (../shared/devtools/images/responsivemode/responsive-horizontal-resizer.png)
|
||||
skin/classic/browser/devtools/responsive-horizontal-resizer@2x.png (../shared/devtools/images/responsivemode/responsive-horizontal-resizer@2x.png)
|
||||
skin/classic/browser/devtools/responsiveui-rotate.png (../shared/devtools/images/responsivemode/responsiveui-rotate.png)
|
||||
skin/classic/browser/devtools/responsiveui-rotate@2x.png (../shared/devtools/images/responsivemode/responsiveui-rotate@2x.png)
|
||||
skin/classic/browser/devtools/responsiveui-touch.png (../shared/devtools/images/responsivemode/responsiveui-touch.png)
|
||||
skin/classic/browser/devtools/responsiveui-touch@2x.png (../shared/devtools/images/responsivemode/responsiveui-touch@2x.png)
|
||||
skin/classic/browser/devtools/responsiveui-screenshot.png (../shared/devtools/images/responsivemode/responsiveui-screenshot.png)
|
||||
skin/classic/browser/devtools/responsiveui-screenshot@2x.png (../shared/devtools/images/responsivemode/responsiveui-screenshot@2x.png)
|
||||
skin/classic/browser/devtools/toggle-tools.png (../shared/devtools/images/toggle-tools.png)
|
||||
skin/classic/browser/devtools/dock-bottom@2x.png (../shared/devtools/images/dock-bottom@2x.png)
|
||||
skin/classic/browser/devtools/dock-side@2x.png (../shared/devtools/images/dock-side@2x.png)
|
||||
|
@ -309,9 +317,6 @@ browser.jar:
|
|||
skin/classic/browser/devtools/font-inspector.css (../shared/devtools/font-inspector.css)
|
||||
skin/classic/browser/devtools/computedview.css (../shared/devtools/computedview.css)
|
||||
skin/classic/browser/devtools/arrow-e.png (../shared/devtools/images/arrow-e.png)
|
||||
skin/classic/browser/devtools/responsiveui-rotate.png (../shared/devtools/responsiveui-rotate.png)
|
||||
skin/classic/browser/devtools/responsiveui-touch.png (../shared/devtools/responsiveui-touch.png)
|
||||
skin/classic/browser/devtools/responsiveui-screenshot.png (../shared/devtools/responsiveui-screenshot.png)
|
||||
skin/classic/browser/devtools/projecteditor/projecteditor.css (../shared/devtools/projecteditor/projecteditor.css)
|
||||
skin/classic/browser/devtools/projecteditor/file-icons-sheet@2x.png (../shared/devtools/projecteditor/file-icons-sheet@2x.png)
|
||||
skin/classic/browser/devtools/app-manager/connection-footer.css (../shared/devtools/app-manager/connection-footer.css)
|
||||
|
|
|
@ -4,6 +4,14 @@
|
|||
|
||||
%include ../../../shared/incontentprefs/preferences.css
|
||||
|
||||
tab[selected] {
|
||||
/* Override styles for tab[selected] from
|
||||
toolkit/themes/linux/global/tabbox.css */
|
||||
margin-bottom: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
|
||||
button > .button-box,
|
||||
menulist > .menulist-label-box {
|
||||
-moz-appearance: none;
|
||||
|
|
|
@ -392,10 +392,18 @@ browser.jar:
|
|||
skin/classic/browser/devtools/tracer-icon@2x.png (../shared/devtools/images/tracer-icon@2x.png)
|
||||
skin/classic/browser/devtools/floating-scrollbars.css (devtools/floating-scrollbars.css)
|
||||
skin/classic/browser/devtools/floating-scrollbars-light.css (devtools/floating-scrollbars-light.css)
|
||||
skin/classic/browser/devtools/responsive-se-resizer.png (../shared/devtools/images/responsive-se-resizer.png)
|
||||
skin/classic/browser/devtools/responsive-vertical-resizer.png (../shared/devtools/images/responsive-vertical-resizer.png)
|
||||
skin/classic/browser/devtools/responsive-horizontal-resizer.png (../shared/devtools/images/responsive-horizontal-resizer.png)
|
||||
skin/classic/browser/devtools/responsive-background.png (../shared/devtools/images/responsive-background.png)
|
||||
skin/classic/browser/devtools/responsive-se-resizer.png (../shared/devtools/images/responsivemode/responsive-se-resizer.png)
|
||||
skin/classic/browser/devtools/responsive-se-resizer@2x.png (../shared/devtools/images/responsivemode/responsive-se-resizer@2x.png)
|
||||
skin/classic/browser/devtools/responsive-vertical-resizer.png (../shared/devtools/images/responsivemode/responsive-vertical-resizer.png)
|
||||
skin/classic/browser/devtools/responsive-vertical-resizer@2x.png (../shared/devtools/images/responsivemode/responsive-vertical-resizer@2x.png)
|
||||
skin/classic/browser/devtools/responsive-horizontal-resizer.png (../shared/devtools/images/responsivemode/responsive-horizontal-resizer.png)
|
||||
skin/classic/browser/devtools/responsive-horizontal-resizer@2x.png (../shared/devtools/images/responsivemode/responsive-horizontal-resizer@2x.png)
|
||||
skin/classic/browser/devtools/responsiveui-rotate.png (../shared/devtools/images/responsivemode/responsiveui-rotate.png)
|
||||
skin/classic/browser/devtools/responsiveui-rotate@2x.png (../shared/devtools/images/responsivemode/responsiveui-rotate@2x.png)
|
||||
skin/classic/browser/devtools/responsiveui-touch.png (../shared/devtools/images/responsivemode/responsiveui-touch.png)
|
||||
skin/classic/browser/devtools/responsiveui-touch@2x.png (../shared/devtools/images/responsivemode/responsiveui-touch@2x.png)
|
||||
skin/classic/browser/devtools/responsiveui-screenshot.png (../shared/devtools/images/responsivemode/responsiveui-screenshot.png)
|
||||
skin/classic/browser/devtools/responsiveui-screenshot@2x.png (../shared/devtools/images/responsivemode/responsiveui-screenshot@2x.png)
|
||||
skin/classic/browser/devtools/toggle-tools.png (../shared/devtools/images/toggle-tools.png)
|
||||
skin/classic/browser/devtools/dock-bottom@2x.png (../shared/devtools/images/dock-bottom@2x.png)
|
||||
skin/classic/browser/devtools/dock-side@2x.png (../shared/devtools/images/dock-side@2x.png)
|
||||
|
@ -427,9 +435,6 @@ browser.jar:
|
|||
skin/classic/browser/devtools/font-inspector.css (../shared/devtools/font-inspector.css)
|
||||
skin/classic/browser/devtools/computedview.css (../shared/devtools/computedview.css)
|
||||
skin/classic/browser/devtools/arrow-e.png (../shared/devtools/images/arrow-e.png)
|
||||
skin/classic/browser/devtools/responsiveui-rotate.png (../shared/devtools/responsiveui-rotate.png)
|
||||
skin/classic/browser/devtools/responsiveui-touch.png (../shared/devtools/responsiveui-touch.png)
|
||||
skin/classic/browser/devtools/responsiveui-screenshot.png (../shared/devtools/responsiveui-screenshot.png)
|
||||
skin/classic/browser/devtools/projecteditor/projecteditor.css (../shared/devtools/projecteditor/projecteditor.css)
|
||||
skin/classic/browser/devtools/projecteditor/file-icons-sheet@2x.png (../shared/devtools/projecteditor/file-icons-sheet@2x.png)
|
||||
skin/classic/browser/devtools/app-manager/connection-footer.css (../shared/devtools/app-manager/connection-footer.css)
|
||||
|
|
|
@ -4,6 +4,20 @@
|
|||
|
||||
%include ../../../shared/incontentprefs/preferences.css
|
||||
|
||||
prefpane .groupbox-title {
|
||||
background: none;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
tabs {
|
||||
padding-right: 0;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
tab[selected] {
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
menulist:not([editable="true"]) > menupopup > menuitem[checked="true"]::before,
|
||||
menulist:not([editable="true"]) > menupopup > menuitem[selected="true"]::before {
|
||||
display: none;
|
||||
|
|
Двоичные данные
browser/themes/shared/devtools/images/responsive-background.png
До Ширина: | Высота: | Размер: 3.1 KiB |
До Ширина: | Высота: | Размер: 256 B |
Двоичные данные
browser/themes/shared/devtools/images/responsive-se-resizer.png
До Ширина: | Высота: | Размер: 339 B |
До Ширина: | Высота: | Размер: 237 B |
Двоичные данные
browser/themes/shared/devtools/images/responsivemode/responsive-horizontal-resizer.png
Normal file
После Ширина: | Высота: | Размер: 102 B |
Двоичные данные
browser/themes/shared/devtools/images/responsivemode/responsive-horizontal-resizer@2x.png
Normal file
После Ширина: | Высота: | Размер: 129 B |
Двоичные данные
browser/themes/shared/devtools/images/responsivemode/responsive-se-resizer.png
Normal file
После Ширина: | Высота: | Размер: 129 B |
Двоичные данные
browser/themes/shared/devtools/images/responsivemode/responsive-se-resizer@2x.png
Normal file
После Ширина: | Высота: | Размер: 205 B |
Двоичные данные
browser/themes/shared/devtools/images/responsivemode/responsive-vertical-resizer.png
Normal file
После Ширина: | Высота: | Размер: 105 B |
Двоичные данные
browser/themes/shared/devtools/images/responsivemode/responsive-vertical-resizer@2x.png
Normal file
После Ширина: | Высота: | Размер: 141 B |
Двоичные данные
browser/themes/shared/devtools/images/responsivemode/responsiveui-rotate.png
Normal file
После Ширина: | Высота: | Размер: 245 B |
Двоичные данные
browser/themes/shared/devtools/images/responsivemode/responsiveui-rotate@2x.png
Normal file
После Ширина: | Высота: | Размер: 438 B |
Двоичные данные
browser/themes/shared/devtools/images/responsivemode/responsiveui-screenshot.png
Normal file
После Ширина: | Высота: | Размер: 303 B |
Двоичные данные
browser/themes/shared/devtools/images/responsivemode/responsiveui-screenshot@2x.png
Normal file
После Ширина: | Высота: | Размер: 531 B |
Двоичные данные
browser/themes/shared/devtools/images/responsivemode/responsiveui-touch.png
Normal file
После Ширина: | Высота: | Размер: 470 B |
Двоичные данные
browser/themes/shared/devtools/images/responsivemode/responsiveui-touch@2x.png
Normal file
После Ширина: | Высота: | Размер: 927 B |
|
@ -7,7 +7,7 @@
|
|||
/* Responsive Mode */
|
||||
|
||||
.browserContainer[responsivemode] {
|
||||
background: #222 url("chrome://browser/skin/devtools/responsive-background.png");
|
||||
background-color: #222;
|
||||
padding: 0 20px 20px 20px;
|
||||
}
|
||||
|
||||
|
@ -43,6 +43,11 @@
|
|||
color: inherit;
|
||||
}
|
||||
|
||||
.devtools-responsiveui-toolbarbutton > .toolbarbutton-icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.devtools-responsiveui-toolbarbutton > .toolbarbutton-menubutton-button {
|
||||
-moz-box-orient: horizontal;
|
||||
}
|
||||
|
@ -135,6 +140,16 @@
|
|||
list-style-image: url("chrome://browser/skin/devtools/responsiveui-rotate.png");
|
||||
}
|
||||
|
||||
@media (min-resolution: 2dppx) {
|
||||
.devtools-responsiveui-close {
|
||||
list-style-image: url("chrome://browser/skin/devtools/close@2x.png");
|
||||
}
|
||||
|
||||
.devtools-responsiveui-rotate {
|
||||
list-style-image: url("chrome://browser/skin/devtools/responsiveui-rotate@2x.png");
|
||||
}
|
||||
}
|
||||
|
||||
.devtools-responsiveui-touch {
|
||||
list-style-image: url("chrome://browser/skin/devtools/responsiveui-touch.png");
|
||||
-moz-image-region: rect(0px,16px,16px,0px);
|
||||
|
@ -144,15 +159,33 @@
|
|||
-moz-image-region: rect(0px,32px,16px,16px);
|
||||
}
|
||||
|
||||
@media (min-resolution: 2dppx) {
|
||||
.devtools-responsiveui-touch {
|
||||
list-style-image: url("chrome://browser/skin/devtools/responsiveui-touch@2x.png");
|
||||
-moz-image-region: rect(0px,32px,32px,0px);
|
||||
}
|
||||
|
||||
.devtools-responsiveui-touch[checked] {
|
||||
-moz-image-region: rect(0px,64px,32px,32px);
|
||||
}
|
||||
}
|
||||
|
||||
.devtools-responsiveui-screenshot {
|
||||
list-style-image: url("chrome://browser/skin/devtools/responsiveui-screenshot.png");
|
||||
}
|
||||
|
||||
@media (min-resolution: 2dppx) {
|
||||
.devtools-responsiveui-screenshot {
|
||||
list-style-image: url("chrome://browser/skin/devtools/responsiveui-screenshot@2x.png");
|
||||
}
|
||||
}
|
||||
|
||||
.devtools-responsiveui-resizebarV {
|
||||
width: 7px;
|
||||
height: 24px;
|
||||
cursor: ew-resize;
|
||||
transform: translate(12px, -12px);
|
||||
background-size: cover;
|
||||
background-image: url("chrome://browser/skin/devtools/responsive-vertical-resizer.png");
|
||||
}
|
||||
|
||||
|
@ -161,6 +194,7 @@
|
|||
height: 7px;
|
||||
cursor: ns-resize;
|
||||
transform: translate(-12px, 12px);
|
||||
background-size: cover;
|
||||
background-image: url("chrome://browser/skin/devtools/responsive-horizontal-resizer.png");
|
||||
}
|
||||
|
||||
|
@ -169,5 +203,20 @@
|
|||
height: 16px;
|
||||
cursor: se-resize;
|
||||
transform: translate(12px, 12px);
|
||||
background-size: cover;
|
||||
background-image: url("chrome://browser/skin/devtools/responsive-se-resizer.png");
|
||||
}
|
||||
|
||||
@media (min-resolution: 2dppx) {
|
||||
.devtools-responsiveui-resizebarV {
|
||||
background-image: url("chrome://browser/skin/devtools/responsive-vertical-resizer@2x.png");
|
||||
}
|
||||
|
||||
.devtools-responsiveui-resizebarH {
|
||||
background-image: url("chrome://browser/skin/devtools/responsive-horizontal-resizer@2x.png");
|
||||
}
|
||||
|
||||
.devtools-responsiveui-resizehandle {
|
||||
background-image: url("chrome://browser/skin/devtools/responsive-se-resizer@2x.png");
|
||||
}
|
||||
}
|
Двоичные данные
browser/themes/shared/devtools/responsiveui-rotate.png
До Ширина: | Высота: | Размер: 498 B |
Двоичные данные
browser/themes/shared/devtools/responsiveui-screenshot.png
До Ширина: | Высота: | Размер: 528 B |
Двоичные данные
browser/themes/shared/devtools/responsiveui-touch.png
До Ширина: | Высота: | Размер: 834 B |
|
@ -12,7 +12,7 @@
|
|||
|
||||
page {
|
||||
-moz-appearance: none;
|
||||
background-image: linear-gradient(#FFFFFF, #EDEDED 100px);
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
* {
|
||||
|
@ -84,10 +84,9 @@ tabpanels {
|
|||
tabs {
|
||||
-moz-margin-start: 60px;
|
||||
margin-bottom: 15px;
|
||||
border-top: 2px solid;
|
||||
border-bottom: 2px solid;
|
||||
-moz-border-top-colors: #BBBBBB #F9F9F9;
|
||||
-moz-border-bottom-colors: #F9F9F9 #BBBBBB;
|
||||
border-top: 1px solid #c1c1c1;
|
||||
border-bottom: 1px solid #c1c1c1;
|
||||
background-color: #fbfbfb;
|
||||
}
|
||||
|
||||
.tabs-left,
|
||||
|
@ -98,38 +97,26 @@ tabs {
|
|||
tab {
|
||||
-moz-appearance: none;
|
||||
margin-top: 0;
|
||||
padding: 0;
|
||||
-moz-margin-end: 30px;
|
||||
min-height: 60px;
|
||||
background-color: transparent;
|
||||
padding: 0 20px;
|
||||
min-height: 44px;
|
||||
color: #424f5a;
|
||||
background-color: #fbfbfb;
|
||||
border-width: 0;
|
||||
border-bottom: 3px solid transparent;
|
||||
transition: background-color 50ms ease 0s;
|
||||
}
|
||||
|
||||
tab:hover {
|
||||
background-color: #ebebeb;
|
||||
}
|
||||
|
||||
tab[selected] {
|
||||
border-bottom-color: #FF9500;
|
||||
background-color: #ebebeb;
|
||||
box-shadow: inset 0 -4px 0 0 #ff9500;
|
||||
}
|
||||
|
||||
.tab-text {
|
||||
font-size: 1.3rem;
|
||||
line-height: 22px;
|
||||
color: #333333;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
tab:not([selected]):hover > .tab-middle > .tab-text {
|
||||
background-color: rgba(255,255,255,0.5);
|
||||
border-color: #FFFFFF;
|
||||
}
|
||||
|
||||
tab:not([selected]):hover:active > .tab-middle > .tab-text {
|
||||
background-color: rgba(0,0,0,0.03);
|
||||
}
|
||||
|
||||
tab[selected] > .tab-middle > .tab-text {
|
||||
font-weight: bold;
|
||||
color: #424E5A;
|
||||
}
|
||||
|
||||
/* buttons and menulists */
|
||||
|
|
|
@ -310,10 +310,18 @@ browser.jar:
|
|||
skin/classic/browser/devtools/debugger-toggleBreakpoints@2x.png (../shared/devtools/images/debugger-toggleBreakpoints@2x.png)
|
||||
skin/classic/browser/devtools/tracer-icon.png (../shared/devtools/images/tracer-icon.png)
|
||||
skin/classic/browser/devtools/tracer-icon@2x.png (../shared/devtools/images/tracer-icon@2x.png)
|
||||
skin/classic/browser/devtools/responsive-se-resizer.png (../shared/devtools/images/responsive-se-resizer.png)
|
||||
skin/classic/browser/devtools/responsive-vertical-resizer.png (../shared/devtools/images/responsive-vertical-resizer.png)
|
||||
skin/classic/browser/devtools/responsive-horizontal-resizer.png (../shared/devtools/images/responsive-horizontal-resizer.png)
|
||||
skin/classic/browser/devtools/responsive-background.png (../shared/devtools/images/responsive-background.png)
|
||||
skin/classic/browser/devtools/responsive-se-resizer.png (../shared/devtools/images/responsivemode/responsive-se-resizer.png)
|
||||
skin/classic/browser/devtools/responsive-se-resizer@2x.png (../shared/devtools/images/responsivemode/responsive-se-resizer@2x.png)
|
||||
skin/classic/browser/devtools/responsive-vertical-resizer.png (../shared/devtools/images/responsivemode/responsive-vertical-resizer.png)
|
||||
skin/classic/browser/devtools/responsive-vertical-resizer@2x.png (../shared/devtools/images/responsivemode/responsive-vertical-resizer@2x.png)
|
||||
skin/classic/browser/devtools/responsive-horizontal-resizer.png (../shared/devtools/images/responsivemode/responsive-horizontal-resizer.png)
|
||||
skin/classic/browser/devtools/responsive-horizontal-resizer@2x.png (../shared/devtools/images/responsivemode/responsive-horizontal-resizer@2x.png)
|
||||
skin/classic/browser/devtools/responsiveui-rotate.png (../shared/devtools/images/responsivemode/responsiveui-rotate.png)
|
||||
skin/classic/browser/devtools/responsiveui-rotate@2x.png (../shared/devtools/images/responsivemode/responsiveui-rotate@2x.png)
|
||||
skin/classic/browser/devtools/responsiveui-touch.png (../shared/devtools/images/responsivemode/responsiveui-touch.png)
|
||||
skin/classic/browser/devtools/responsiveui-touch@2x.png (../shared/devtools/images/responsivemode/responsiveui-touch@2x.png)
|
||||
skin/classic/browser/devtools/responsiveui-screenshot.png (../shared/devtools/images/responsivemode/responsiveui-screenshot.png)
|
||||
skin/classic/browser/devtools/responsiveui-screenshot@2x.png (../shared/devtools/images/responsivemode/responsiveui-screenshot@2x.png)
|
||||
skin/classic/browser/devtools/toggle-tools.png (../shared/devtools/images/toggle-tools.png)
|
||||
skin/classic/browser/devtools/dock-bottom@2x.png (../shared/devtools/images/dock-bottom@2x.png)
|
||||
skin/classic/browser/devtools/dock-side@2x.png (../shared/devtools/images/dock-side@2x.png)
|
||||
|
@ -346,9 +354,6 @@ browser.jar:
|
|||
skin/classic/browser/devtools/font-inspector.css (../shared/devtools/font-inspector.css)
|
||||
skin/classic/browser/devtools/computedview.css (../shared/devtools/computedview.css)
|
||||
skin/classic/browser/devtools/arrow-e.png (../shared/devtools/images/arrow-e.png)
|
||||
skin/classic/browser/devtools/responsiveui-rotate.png (../shared/devtools/responsiveui-rotate.png)
|
||||
skin/classic/browser/devtools/responsiveui-touch.png (../shared/devtools/responsiveui-touch.png)
|
||||
skin/classic/browser/devtools/responsiveui-screenshot.png (../shared/devtools/responsiveui-screenshot.png)
|
||||
skin/classic/browser/devtools/projecteditor/projecteditor.css (../shared/devtools/projecteditor/projecteditor.css)
|
||||
skin/classic/browser/devtools/projecteditor/file-icons-sheet@2x.png (../shared/devtools/projecteditor/file-icons-sheet@2x.png)
|
||||
skin/classic/browser/devtools/app-manager/connection-footer.css (../shared/devtools/app-manager/connection-footer.css)
|
||||
|
@ -705,10 +710,18 @@ browser.jar:
|
|||
skin/classic/aero/browser/devtools/debugger-toggleBreakpoints@2x.png (../shared/devtools/images/debugger-toggleBreakpoints@2x.png)
|
||||
skin/classic/aero/browser/devtools/tracer-icon.png (../shared/devtools/images/tracer-icon.png)
|
||||
skin/classic/aero/browser/devtools/tracer-icon@2x.png (../shared/devtools/images/tracer-icon@2x.png)
|
||||
skin/classic/aero/browser/devtools/responsive-se-resizer.png (../shared/devtools/images/responsive-se-resizer.png)
|
||||
skin/classic/aero/browser/devtools/responsive-vertical-resizer.png (../shared/devtools/images/responsive-vertical-resizer.png)
|
||||
skin/classic/aero/browser/devtools/responsive-horizontal-resizer.png (../shared/devtools/images/responsive-horizontal-resizer.png)
|
||||
skin/classic/aero/browser/devtools/responsive-background.png (../shared/devtools/images/responsive-background.png)
|
||||
skin/classic/aero/browser/devtools/responsive-se-resizer.png (../shared/devtools/images/responsivemode/responsive-se-resizer.png)
|
||||
skin/classic/aero/browser/devtools/responsive-se-resizer@2x.png (../shared/devtools/images/responsivemode/responsive-se-resizer@2x.png)
|
||||
skin/classic/aero/browser/devtools/responsive-vertical-resizer.png (../shared/devtools/images/responsivemode/responsive-vertical-resizer.png)
|
||||
skin/classic/aero/browser/devtools/responsive-vertical-resizer@2x.png (../shared/devtools/images/responsivemode/responsive-vertical-resizer@2x.png)
|
||||
skin/classic/aero/browser/devtools/responsive-horizontal-resizer.png (../shared/devtools/images/responsivemode/responsive-horizontal-resizer.png)
|
||||
skin/classic/aero/browser/devtools/responsive-horizontal-resizer@2x.png (../shared/devtools/images/responsivemode/responsive-horizontal-resizer@2x.png)
|
||||
skin/classic/aero/browser/devtools/responsiveui-rotate.png (../shared/devtools/images/responsivemode/responsiveui-rotate.png)
|
||||
skin/classic/aero/browser/devtools/responsiveui-rotate@2x.png (../shared/devtools/images/responsivemode/responsiveui-rotate@2x.png)
|
||||
skin/classic/aero/browser/devtools/responsiveui-touch.png (../shared/devtools/images/responsivemode/responsiveui-touch.png)
|
||||
skin/classic/aero/browser/devtools/responsiveui-touch@2x.png (../shared/devtools/images/responsivemode/responsiveui-touch@2x.png)
|
||||
skin/classic/aero/browser/devtools/responsiveui-screenshot.png (../shared/devtools/images/responsivemode/responsiveui-screenshot.png)
|
||||
skin/classic/aero/browser/devtools/responsiveui-screenshot@2x.png (../shared/devtools/images/responsivemode/responsiveui-screenshot@2x.png)
|
||||
skin/classic/aero/browser/devtools/toggle-tools.png (../shared/devtools/images/toggle-tools.png)
|
||||
skin/classic/aero/browser/devtools/dock-bottom@2x.png (../shared/devtools/images/dock-bottom@2x.png)
|
||||
skin/classic/aero/browser/devtools/dock-side@2x.png (../shared/devtools/images/dock-side@2x.png)
|
||||
|
@ -741,9 +754,6 @@ browser.jar:
|
|||
skin/classic/aero/browser/devtools/font-inspector.css (../shared/devtools/font-inspector.css)
|
||||
skin/classic/aero/browser/devtools/computedview.css (../shared/devtools/computedview.css)
|
||||
skin/classic/aero/browser/devtools/arrow-e.png (../shared/devtools/images/arrow-e.png)
|
||||
skin/classic/aero/browser/devtools/responsiveui-rotate.png (../shared/devtools/responsiveui-rotate.png)
|
||||
skin/classic/aero/browser/devtools/responsiveui-touch.png (../shared/devtools/responsiveui-touch.png)
|
||||
skin/classic/aero/browser/devtools/responsiveui-screenshot.png (../shared/devtools/responsiveui-screenshot.png)
|
||||
skin/classic/aero/browser/devtools/projecteditor/projecteditor.css (../shared/devtools/projecteditor/projecteditor.css)
|
||||
skin/classic/aero/browser/devtools/projecteditor/file-icons-sheet@2x.png (../shared/devtools/projecteditor/file-icons-sheet@2x.png)
|
||||
skin/classic/aero/browser/devtools/app-manager/connection-footer.css (../shared/devtools/app-manager/connection-footer.css)
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
|
||||
%include ../../../shared/incontentprefs/preferences.css
|
||||
|
||||
caption {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
menulist:not([editable="true"]) > .menulist-dropmarker {
|
||||
margin-top: 1px;
|
||||
margin-bottom: 1px;
|
||||
|
|
|
@ -103,7 +103,7 @@ public:
|
|||
}
|
||||
|
||||
AutoPushJSContext cx(sc->GetNativeContext());
|
||||
JSObject* JsDevices = nullptr;
|
||||
JS::Rooted<JSObject*> JsDevices(cx);
|
||||
rv = nsTArrayToJSArray(cx, devices, &JsDevices);
|
||||
if (!JsDevices) {
|
||||
BT_WARNING("Cannot create JS array!");
|
||||
|
@ -260,7 +260,7 @@ BluetoothAdapter::SetPropertyByValue(const BluetoothNamedValue& aValue)
|
|||
|
||||
AutoPushJSContext cx(sc->GetNativeContext());
|
||||
JS::Rooted<JSObject*> uuids(cx);
|
||||
if (NS_FAILED(nsTArrayToJSArray(cx, mUuids, uuids.address()))) {
|
||||
if (NS_FAILED(nsTArrayToJSArray(cx, mUuids, &uuids))) {
|
||||
BT_WARNING("Cannot set JS UUIDs object!");
|
||||
return;
|
||||
}
|
||||
|
@ -276,8 +276,7 @@ BluetoothAdapter::SetPropertyByValue(const BluetoothNamedValue& aValue)
|
|||
|
||||
AutoPushJSContext cx(sc->GetNativeContext());
|
||||
JS::Rooted<JSObject*> deviceAddresses(cx);
|
||||
if (NS_FAILED(nsTArrayToJSArray(cx, mDeviceAddresses,
|
||||
deviceAddresses.address()))) {
|
||||
if (NS_FAILED(nsTArrayToJSArray(cx, mDeviceAddresses, &deviceAddresses))) {
|
||||
BT_WARNING("Cannot set JS Devices object!");
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -137,7 +137,7 @@ BluetoothDevice::SetPropertyByValue(const BluetoothNamedValue& aValue)
|
|||
AutoPushJSContext cx(sc->GetNativeContext());
|
||||
|
||||
JS::Rooted<JSObject*> uuids(cx);
|
||||
if (NS_FAILED(nsTArrayToJSArray(cx, mUuids, uuids.address()))) {
|
||||
if (NS_FAILED(nsTArrayToJSArray(cx, mUuids, &uuids))) {
|
||||
BT_WARNING("Cannot set JS UUIDs object!");
|
||||
return;
|
||||
}
|
||||
|
@ -153,7 +153,7 @@ BluetoothDevice::SetPropertyByValue(const BluetoothNamedValue& aValue)
|
|||
AutoPushJSContext cx(sc->GetNativeContext());
|
||||
|
||||
JS::Rooted<JSObject*> services(cx);
|
||||
if (NS_FAILED(nsTArrayToJSArray(cx, mServices, services.address()))) {
|
||||
if (NS_FAILED(nsTArrayToJSArray(cx, mServices, &services))) {
|
||||
BT_WARNING("Cannot set JS Services object!");
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -181,7 +181,6 @@ TelephonyListener::CallStateChanged(uint32_t aServiceId,
|
|||
uint32_t aCallIndex,
|
||||
uint16_t aCallState,
|
||||
const nsAString& aNumber,
|
||||
bool aIsActive,
|
||||
bool aIsOutgoing,
|
||||
bool aIsEmergency,
|
||||
bool aIsConference,
|
||||
|
@ -201,7 +200,6 @@ TelephonyListener::EnumerateCallState(uint32_t aServiceId,
|
|||
uint32_t aCallIndex,
|
||||
uint16_t aCallState,
|
||||
const nsAString_internal& aNumber,
|
||||
bool aIsActive,
|
||||
bool aIsOutgoing,
|
||||
bool aIsEmergency,
|
||||
bool aIsConference,
|
||||
|
|
|
@ -416,19 +416,6 @@ abstract public class BrowserApp extends GeckoApp
|
|||
return values;
|
||||
}
|
||||
|
||||
void handleReaderRemoved(final String url) {
|
||||
ThreadUtils.postToBackgroundThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
BrowserDB.removeReadingListItemWithURL(getContentResolver(), url);
|
||||
showToast(R.string.page_removed, Toast.LENGTH_SHORT);
|
||||
|
||||
final int count = BrowserDB.getReadingListCount(getContentResolver());
|
||||
GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("Reader:ListCountUpdated", Integer.toString(count)));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void handleReaderFaviconRequest(final String url) {
|
||||
(new UiAsyncTask<Void, Void, String>(ThreadUtils.getBackgroundHandler()) {
|
||||
@Override
|
||||
|
@ -542,7 +529,6 @@ abstract public class BrowserApp extends GeckoApp
|
|||
"Menu:Add",
|
||||
"Menu:Remove",
|
||||
"Reader:ListStatusRequest",
|
||||
"Reader:Removed",
|
||||
"Reader:Share",
|
||||
"Settings:Show",
|
||||
"Telemetry:Gather",
|
||||
|
@ -900,7 +886,6 @@ abstract public class BrowserApp extends GeckoApp
|
|||
"Menu:Add",
|
||||
"Menu:Remove",
|
||||
"Reader:ListStatusRequest",
|
||||
"Reader:Removed",
|
||||
"Reader:Share",
|
||||
"Settings:Show",
|
||||
"Telemetry:Gather",
|
||||
|
@ -1231,10 +1216,6 @@ abstract public class BrowserApp extends GeckoApp
|
|||
} else if ("Reader:ListStatusRequest".equals(event)) {
|
||||
handleReaderListStatusRequest(message.getString("url"));
|
||||
|
||||
} else if ("Reader:Removed".equals(event)) {
|
||||
final String url = message.getString("url");
|
||||
handleReaderRemoved(url);
|
||||
|
||||
} else if ("Reader:Share".equals(event)) {
|
||||
final String title = message.getString("title");
|
||||
final String url = message.getString("url");
|
||||
|
|
|
@ -499,10 +499,6 @@ public abstract class GeckoApp
|
|||
protected void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
|
||||
if (mToast != null) {
|
||||
mToast.onSaveInstanceState(outState);
|
||||
}
|
||||
|
||||
outState.putBoolean(SAVED_STATE_IN_BACKGROUND, isApplicationInBackground());
|
||||
outState.putString(SAVED_STATE_PRIVATE_SESSION, mPrivateBrowsingSession);
|
||||
}
|
||||
|
|
|
@ -154,8 +154,15 @@ public class Telemetry {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param method A non-null method (if null is desired, consider using Method.NONE)
|
||||
*/
|
||||
private static void sendUIEvent(final String eventName, final Method method,
|
||||
final long timestamp, final String extras) {
|
||||
if (method == null) {
|
||||
throw new IllegalArgumentException("Expected non-null method - use Method.NONE?");
|
||||
}
|
||||
|
||||
Log.d(LOGTAG, "SendUIEvent: event = " + eventName + " method = " + method +
|
||||
" timestamp = " + timestamp + " extras = " + extras);
|
||||
final GeckoEvent geckoEvent = GeckoEvent.createTelemetryUIEvent(
|
||||
|
|
|
@ -26,6 +26,7 @@ import org.mozilla.gecko.PrefsHelper;
|
|||
import org.mozilla.gecko.R;
|
||||
import org.mozilla.gecko.Telemetry;
|
||||
import org.mozilla.gecko.TelemetryContract;
|
||||
import org.mozilla.gecko.TelemetryContract.Method;
|
||||
import org.mozilla.gecko.background.announcements.AnnouncementsConstants;
|
||||
import org.mozilla.gecko.background.common.GlobalConstants;
|
||||
import org.mozilla.gecko.background.healthreport.HealthReportConstants;
|
||||
|
@ -854,9 +855,9 @@ OnSharedPreferenceChangeListener
|
|||
if (null == localeManager.setSelectedLocale(context, newValue)) {
|
||||
localeManager.updateConfiguration(context, Locale.getDefault());
|
||||
}
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.LOCALE_BROWSER_UNSELECTED, null,
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.LOCALE_BROWSER_UNSELECTED, Method.NONE,
|
||||
currentLocale == null ? "unknown" : currentLocale);
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.LOCALE_BROWSER_SELECTED, null, newValue);
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.LOCALE_BROWSER_SELECTED, Method.NONE, newValue);
|
||||
}
|
||||
|
||||
ThreadUtils.postToUiThread(new Runnable() {
|
||||
|
|
|
@ -6,6 +6,7 @@ package org.mozilla.gecko.preferences;
|
|||
|
||||
import org.mozilla.gecko.Telemetry;
|
||||
import org.mozilla.gecko.TelemetryContract;
|
||||
import org.mozilla.gecko.TelemetryContract.Method;
|
||||
import org.mozilla.gecko.home.HomeConfig;
|
||||
import org.mozilla.gecko.home.HomeConfig.PanelConfig;
|
||||
import org.mozilla.gecko.home.HomeConfig.State;
|
||||
|
@ -162,7 +163,7 @@ public class PanelsPreferenceCategory extends CustomListCategory {
|
|||
mConfigEditor.setDefault(id);
|
||||
mConfigEditor.apply();
|
||||
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.PANEL_SET_DEFAULT, null, id);
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.PANEL_SET_DEFAULT, Method.NONE, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -38,13 +38,12 @@ public class ButtonToast {
|
|||
private final TextView mMessageView;
|
||||
private final Button mButton;
|
||||
private final Handler mHideHandler = new Handler();
|
||||
|
||||
private final LinkedList<Toast> mQueue = new LinkedList<Toast>();
|
||||
private Toast mCurrentToast;
|
||||
|
||||
public enum ReasonHidden {
|
||||
CLICKED,
|
||||
TIMEOUT,
|
||||
REPLACED,
|
||||
STARTUP
|
||||
}
|
||||
|
||||
|
@ -104,10 +103,10 @@ public class ButtonToast {
|
|||
}
|
||||
|
||||
private void show(Toast t, boolean immediate) {
|
||||
// If we're already showing a toast, add this one to the queue to show later
|
||||
if (mView.getVisibility() == View.VISIBLE) {
|
||||
mQueue.offer(t);
|
||||
return;
|
||||
// If we're already showing a toast, replace it with the new one by hiding the old one and quickly showing the new one.
|
||||
if (mCurrentToast != null) {
|
||||
hide(true, ReasonHidden.REPLACED);
|
||||
immediate = true;
|
||||
}
|
||||
|
||||
mCurrentToast = t;
|
||||
|
@ -130,11 +129,6 @@ public class ButtonToast {
|
|||
}
|
||||
|
||||
public void hide(boolean immediate, ReasonHidden reason) {
|
||||
if (mButton.isPressed() && reason != ReasonHidden.CLICKED) {
|
||||
mHideHandler.postDelayed(mHideRunnable, TOAST_DURATION);
|
||||
return;
|
||||
}
|
||||
|
||||
if (mCurrentToast != null && mCurrentToast.listener != null) {
|
||||
mCurrentToast.listener.onToastHidden(reason);
|
||||
}
|
||||
|
@ -146,7 +140,6 @@ public class ButtonToast {
|
|||
mView.clearAnimation();
|
||||
if (immediate) {
|
||||
mView.setVisibility(View.GONE);
|
||||
showNextInQueue();
|
||||
} else {
|
||||
// Using Android's animation frameworks will not correctly turn off clicking.
|
||||
// See bug 885717.
|
||||
|
@ -157,7 +150,6 @@ public class ButtonToast {
|
|||
// onAnimationEnd will be called when the app is restored
|
||||
public void onPropertyAnimationEnd() {
|
||||
mView.setVisibility(View.GONE);
|
||||
showNextInQueue();
|
||||
}
|
||||
public void onPropertyAnimationStart() { }
|
||||
});
|
||||
|
@ -165,20 +157,6 @@ public class ButtonToast {
|
|||
}
|
||||
}
|
||||
|
||||
public void onSaveInstanceState(Bundle outState) {
|
||||
// Add whatever toast we're currently showing to the front of the queue
|
||||
if (mCurrentToast != null) {
|
||||
mQueue.add(0, mCurrentToast);
|
||||
}
|
||||
}
|
||||
|
||||
private void showNextInQueue() {
|
||||
Toast t = mQueue.poll();
|
||||
if (t != null) {
|
||||
show(t, false);
|
||||
}
|
||||
}
|
||||
|
||||
private Runnable mHideRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
|
|
@ -7523,13 +7523,6 @@ let Reader = {
|
|||
let url = aData;
|
||||
this.removeArticleFromCache(url, function(success) {
|
||||
this.log("Reader:Remove success=" + success + ", url=" + url);
|
||||
|
||||
if (success) {
|
||||
sendMessageToJava({
|
||||
type: "Reader:Removed",
|
||||
url: url
|
||||
});
|
||||
}
|
||||
}.bind(this));
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -376,22 +376,26 @@
|
|||
<handler event="keypress" keycode="VK_UP" phase="target">
|
||||
this.checkAdjacentElement(false);
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
</handler>
|
||||
<handler event="keypress" keycode="VK_LEFT" phase="target">
|
||||
// left arrow goes back when we are ltr, forward when we are rtl
|
||||
this.checkAdjacentElement(document.defaultView.getComputedStyle(
|
||||
this, "").direction == "rtl");
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
</handler>
|
||||
<handler event="keypress" keycode="VK_DOWN" phase="target">
|
||||
this.checkAdjacentElement(true);
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
</handler>
|
||||
<handler event="keypress" keycode="VK_RIGHT" phase="target">
|
||||
// right arrow goes forward when we are ltr, back when we are rtl
|
||||
this.checkAdjacentElement(document.defaultView.getComputedStyle(
|
||||
this, "").direction == "ltr");
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
</handler>
|
||||
|
||||
<!-- set a focused attribute on the selected item when the group
|
||||
|
|
|
@ -30,6 +30,7 @@ const protocol = require("devtools/server/protocol");
|
|||
const {method, Arg, RetVal, types} = protocol;
|
||||
const events = require("sdk/event/core");
|
||||
const Heritage = require("sdk/core/heritage");
|
||||
const {setTimeout, clearTimeout} = require("sdk/timers");
|
||||
const EventEmitter = require("devtools/toolkit/event-emitter");
|
||||
|
||||
exports.register = function(handle) {
|
||||
|
@ -148,7 +149,6 @@ exports.ReflowFront = protocol.FrontClass(ReflowActor, {
|
|||
*/
|
||||
function Observable(tabActor, callback) {
|
||||
this.tabActor = tabActor;
|
||||
this.win = tabActor.window;
|
||||
this.callback = callback;
|
||||
}
|
||||
|
||||
|
@ -199,7 +199,6 @@ Observable.prototype = {
|
|||
destroy: function() {
|
||||
this.stop();
|
||||
this.callback = null;
|
||||
this.win = null;
|
||||
this.tabActor = null;
|
||||
}
|
||||
};
|
||||
|
@ -237,6 +236,8 @@ function LayoutChangesObserver(tabActor) {
|
|||
EventEmitter.decorate(this);
|
||||
}
|
||||
|
||||
exports.LayoutChangesObserver = LayoutChangesObserver;
|
||||
|
||||
LayoutChangesObserver.prototype = Heritage.extend(Observable.prototype, {
|
||||
/**
|
||||
* How long does this observer waits before emitting a batched reflows event.
|
||||
|
@ -281,12 +282,20 @@ LayoutChangesObserver.prototype = Heritage.extend(Observable.prototype, {
|
|||
this.emit("reflows", this.reflows);
|
||||
this.reflows = [];
|
||||
}
|
||||
this.eventLoopTimer = this.win.setTimeout(this._startEventLoop,
|
||||
this.eventLoopTimer = this._setTimeout(this._startEventLoop,
|
||||
this.EVENT_BATCHING_DELAY);
|
||||
},
|
||||
|
||||
_stopEventLoop: function() {
|
||||
this.win.clearTimeout(this.eventLoopTimer);
|
||||
this._clearTimeout(this.eventLoopTimer);
|
||||
},
|
||||
|
||||
// Exposing set/clearTimeout here to let tests override them if needed
|
||||
_setTimeout: function(cb, ms) {
|
||||
return setTimeout(cb, ms);
|
||||
},
|
||||
_clearTimeout: function(t) {
|
||||
return clearTimeout(t);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -362,21 +371,60 @@ exports.releaseLayoutChangesObserver = releaseLayoutChangesObserver;
|
|||
*/
|
||||
function ReflowObserver(tabActor, callback) {
|
||||
Observable.call(this, tabActor, callback);
|
||||
this.docshell = this.win.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIWebNavigation)
|
||||
.QueryInterface(Ci.nsIDocShell);
|
||||
|
||||
this._onWindowReady = this._onWindowReady.bind(this);
|
||||
events.on(this.tabActor, "window-ready", this._onWindowReady);
|
||||
this._onWindowDestroyed = this._onWindowDestroyed.bind(this);
|
||||
events.on(this.tabActor, "window-destroyed", this._onWindowDestroyed);
|
||||
}
|
||||
|
||||
ReflowObserver.prototype = Heritage.extend(Observable.prototype, {
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIReflowObserver,
|
||||
Ci.nsISupportsWeakReference]),
|
||||
|
||||
_onWindowReady: function({window}) {
|
||||
if (this.observing) {
|
||||
this._startListeners([window]);
|
||||
}
|
||||
},
|
||||
|
||||
_onWindowDestroyed: function({window}) {
|
||||
if (this.observing) {
|
||||
this._stopListeners([window]);
|
||||
}
|
||||
},
|
||||
|
||||
_start: function() {
|
||||
this.docshell.addWeakReflowObserver(this);
|
||||
this._startListeners(this.tabActor.windows);
|
||||
},
|
||||
|
||||
_stop: function() {
|
||||
this.docshell.removeWeakReflowObserver(this);
|
||||
if (this.tabActor.attached && this.tabActor.docShell) {
|
||||
// It's only worth stopping if the tabActor is still attached
|
||||
this._stopListeners(this.tabActor.windows);
|
||||
}
|
||||
},
|
||||
|
||||
_startListeners: function(windows) {
|
||||
for (let window of windows) {
|
||||
let docshell = window.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIWebNavigation)
|
||||
.QueryInterface(Ci.nsIDocShell);
|
||||
docshell.addWeakReflowObserver(this);
|
||||
}
|
||||
},
|
||||
|
||||
_stopListeners: function(windows) {
|
||||
for (let window of windows) {
|
||||
// Corner cases where a global has already been freed may happen, in which
|
||||
// case, no need to remove the observer
|
||||
try {
|
||||
let docshell = window.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIWebNavigation)
|
||||
.QueryInterface(Ci.nsIDocShell);
|
||||
docshell.removeWeakReflowObserver(this);
|
||||
} catch (e) {}
|
||||
}
|
||||
},
|
||||
|
||||
reflow: function(start, end) {
|
||||
|
@ -388,7 +436,13 @@ ReflowObserver.prototype = Heritage.extend(Observable.prototype, {
|
|||
},
|
||||
|
||||
destroy: function() {
|
||||
if (this._isDestroyed) {
|
||||
return;
|
||||
}
|
||||
this._isDestroyed = true;
|
||||
|
||||
events.off(this.tabActor, "window-ready", this._onWindowReady);
|
||||
events.off(this.tabActor, "window-destroyed", this._onWindowDestroyed);
|
||||
Observable.prototype.destroy.call(this);
|
||||
this.docshell = null;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -141,18 +141,52 @@ RootActor.prototype = {
|
|||
*/
|
||||
get window() Services.wm.getMostRecentWindow(DebuggerServer.chromeWindowType),
|
||||
|
||||
/**
|
||||
* The list of all windows
|
||||
*/
|
||||
get windows() {
|
||||
return this.docShells.map(docShell => {
|
||||
return docShell.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDOMWindow);
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* URL of the chrome window.
|
||||
*/
|
||||
get url() { return this.window ? this.window.document.location.href : null; },
|
||||
|
||||
/**
|
||||
* The top level window's docshell
|
||||
*/
|
||||
get docShell() {
|
||||
return this.window
|
||||
.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDocShell);
|
||||
},
|
||||
|
||||
/**
|
||||
* The list of all docshells
|
||||
*/
|
||||
get docShells() {
|
||||
let docShellsEnum = this.docShell.getDocShellEnumerator(
|
||||
Ci.nsIDocShellTreeItem.typeAll,
|
||||
Ci.nsIDocShell.ENUMERATE_FORWARDS
|
||||
);
|
||||
|
||||
let docShells = [];
|
||||
while (docShellsEnum.hasMoreElements()) {
|
||||
docShells.push(docShellsEnum.getNext());
|
||||
}
|
||||
|
||||
return docShells;
|
||||
},
|
||||
|
||||
/**
|
||||
* Getter for the best nsIWebProgress for to watching this window.
|
||||
*/
|
||||
get webProgress() {
|
||||
return this.window
|
||||
.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDocShell)
|
||||
return this.docShell
|
||||
.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIWebProgress);
|
||||
},
|
||||
|
|
|
@ -13,7 +13,7 @@ let { RootActor } = require("devtools/server/actors/root");
|
|||
let { AddonThreadActor, ThreadActor } = require("devtools/server/actors/script");
|
||||
let { DebuggerServer } = require("devtools/server/main");
|
||||
let DevToolsUtils = require("devtools/toolkit/DevToolsUtils");
|
||||
let { dbg_assert, dumpn } = DevToolsUtils;
|
||||
let { dbg_assert } = DevToolsUtils;
|
||||
|
||||
let {Promise: promise} = Cu.import("resource://gre/modules/Promise.jsm", {});
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
@ -567,6 +567,24 @@ TabActor.prototype = {
|
|||
throw "The docShell getter should be implemented by a subclass of TabActor";
|
||||
},
|
||||
|
||||
/**
|
||||
* Getter for the list of all docshell in this tabActor
|
||||
* @return {Array}
|
||||
*/
|
||||
get docShells() {
|
||||
let docShellsEnum = this.docShell.getDocShellEnumerator(
|
||||
Ci.nsIDocShellTreeItem.typeAll,
|
||||
Ci.nsIDocShell.ENUMERATE_FORWARDS
|
||||
);
|
||||
|
||||
let docShells = [];
|
||||
while (docShellsEnum.hasMoreElements()) {
|
||||
docShells.push(docShellsEnum.getNext());
|
||||
}
|
||||
|
||||
return docShells;
|
||||
},
|
||||
|
||||
/**
|
||||
* Getter for the tab content's DOM window.
|
||||
*/
|
||||
|
@ -576,6 +594,17 @@ TabActor.prototype = {
|
|||
.getInterface(Ci.nsIDOMWindow);
|
||||
},
|
||||
|
||||
/**
|
||||
* Getter for the list of all content DOM windows in this tabActor
|
||||
* @return {Array}
|
||||
*/
|
||||
get windows() {
|
||||
return this.docShells.map(docShell => {
|
||||
return docShell.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDOMWindow);
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Getter for the nsIWebProgress for watching this window.
|
||||
*/
|
||||
|
@ -740,7 +769,7 @@ TabActor.prototype = {
|
|||
/**
|
||||
* Does the actual work of detaching from a tab.
|
||||
*
|
||||
* @returns false if the tab wasn't attached or true of detahing succeeds.
|
||||
* @returns false if the tab wasn't attached or true of detaching succeeds.
|
||||
*/
|
||||
_detach: function BTA_detach() {
|
||||
if (!this.attached) {
|
||||
|
@ -752,6 +781,7 @@ TabActor.prototype = {
|
|||
if (this.docShell) {
|
||||
this._progressListener.unwatch(this.docShell);
|
||||
}
|
||||
this._progressListener.destroy();
|
||||
this._progressListener = null;
|
||||
|
||||
this._popContext();
|
||||
|
@ -945,7 +975,6 @@ TabActor.prototype = {
|
|||
*/
|
||||
_windowReady: function (window) {
|
||||
let isTopLevel = window == this.window;
|
||||
dumpn("window-ready: " + window.location + " isTopLevel:" + isTopLevel);
|
||||
|
||||
events.emit(this, "window-ready", {
|
||||
window: window,
|
||||
|
@ -970,6 +999,13 @@ TabActor.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
_windowDestroyed: function (window) {
|
||||
events.emit(this, "window-destroyed", {
|
||||
window: window,
|
||||
isTopLevel: window == this.window
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Start notifying server codebase and client about a new document
|
||||
* being loaded in the currently targeted context.
|
||||
|
@ -989,7 +1025,6 @@ TabActor.prototype = {
|
|||
request: request
|
||||
});
|
||||
|
||||
|
||||
// We don't do anything for inner frames in TabActor.
|
||||
// (we will only update thread actor on window-ready)
|
||||
if (!isTopLevel) {
|
||||
|
@ -1390,6 +1425,15 @@ BrowserAddonActor.prototype.requestTypes = {
|
|||
function DebuggerProgressListener(aTabActor) {
|
||||
this._tabActor = aTabActor;
|
||||
this._onWindowCreated = this.onWindowCreated.bind(this);
|
||||
this._onWindowHidden = this.onWindowHidden.bind(this);
|
||||
|
||||
// Watch for windows destroyed (global observer that will need filtering)
|
||||
Services.obs.addObserver(this, "inner-window-destroyed", false);
|
||||
|
||||
// XXX: for now we maintain the list of windows we know about in this instance
|
||||
// so that we can discriminate windows we care about when observing
|
||||
// inner-window-destroyed events. Bug 1016952 would remove the need for this.
|
||||
this._knownWindowIDs = new Map();
|
||||
}
|
||||
|
||||
DebuggerProgressListener.prototype = {
|
||||
|
@ -1399,7 +1443,13 @@ DebuggerProgressListener.prototype = {
|
|||
Ci.nsISupports,
|
||||
]),
|
||||
|
||||
watch: function DPL_watch(docShell) {
|
||||
destroy: function() {
|
||||
Services.obs.removeObserver(this, "inner-window-destroyed", false);
|
||||
this._knownWindowIDs.clear();
|
||||
this._knownWindowIDs = null;
|
||||
},
|
||||
|
||||
watch: function(docShell) {
|
||||
let webProgress = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIWebProgress);
|
||||
webProgress.addProgressListener(this, Ci.nsIWebProgress.NOTIFY_STATUS |
|
||||
|
@ -1407,52 +1457,116 @@ DebuggerProgressListener.prototype = {
|
|||
Ci.nsIWebProgress.NOTIFY_STATE_DOCUMENT);
|
||||
|
||||
// TODO: fix docShell.chromeEventHandler in child processes!
|
||||
let chromeEventHandler = docShell.chromeEventHandler ||
|
||||
docShell.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIContentFrameMessageManager);
|
||||
let handler = docShell.chromeEventHandler ||
|
||||
docShell.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIContentFrameMessageManager);
|
||||
|
||||
// Watch for globals being created in this docshell tree.
|
||||
chromeEventHandler.addEventListener("DOMWindowCreated",
|
||||
this._onWindowCreated, true);
|
||||
chromeEventHandler.addEventListener("pageshow",
|
||||
this._onWindowCreated, true);
|
||||
handler.addEventListener("DOMWindowCreated", this._onWindowCreated, true);
|
||||
handler.addEventListener("pageshow", this._onWindowCreated, true);
|
||||
handler.addEventListener("pagehide", this._onWindowHidden, true);
|
||||
|
||||
// Dispatch the _windowReady event on the tabActor for pre-existing windows
|
||||
for (let win of this._getWindowsInDocShell(docShell)) {
|
||||
this._tabActor._windowReady(win);
|
||||
this._knownWindowIDs.set(this._getWindowID(win), win);
|
||||
}
|
||||
},
|
||||
|
||||
unwatch: function DPL_unwatch(docShell) {
|
||||
unwatch: function(docShell) {
|
||||
let webProgress = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIWebProgress);
|
||||
webProgress.removeProgressListener(this);
|
||||
|
||||
// TODO: fix docShell.chromeEventHandler in child processes!
|
||||
let chromeEventHandler = docShell.chromeEventHandler ||
|
||||
docShell.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIContentFrameMessageManager);
|
||||
chromeEventHandler.removeEventListener("DOMWindowCreated",
|
||||
this._onWindowCreated, true);
|
||||
chromeEventHandler.removeEventListener("pageshow",
|
||||
this._onWindowCreated, true);
|
||||
let handler = docShell.chromeEventHandler ||
|
||||
docShell.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIContentFrameMessageManager);
|
||||
|
||||
handler.removeEventListener("DOMWindowCreated", this._onWindowCreated, true);
|
||||
handler.removeEventListener("pageshow", this._onWindowCreated, true);
|
||||
handler.removeEventListener("pagehide", this._onWindowHidden, true);
|
||||
|
||||
for (let win of this._getWindowsInDocShell(docShell)) {
|
||||
this._knownWindowIDs.delete(this._getWindowID(win));
|
||||
}
|
||||
},
|
||||
|
||||
onWindowCreated:
|
||||
DevToolsUtils.makeInfallible(function DPL_onWindowCreated(evt) {
|
||||
// Ignore any event if the tab actor isn't attached.
|
||||
_getWindowsInDocShell: function(docShell) {
|
||||
let docShellsEnum = docShell.getDocShellEnumerator(
|
||||
Ci.nsIDocShellTreeItem.typeAll,
|
||||
Ci.nsIDocShell.ENUMERATE_FORWARDS
|
||||
);
|
||||
|
||||
let windows = [];
|
||||
while (docShellsEnum.hasMoreElements()) {
|
||||
let w = docShellsEnum.getNext().QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDOMWindow);
|
||||
windows.push(w);
|
||||
}
|
||||
return windows;
|
||||
},
|
||||
|
||||
_getWindowID: function(window) {
|
||||
return window.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDOMWindowUtils)
|
||||
.currentInnerWindowID;
|
||||
},
|
||||
|
||||
onWindowCreated: DevToolsUtils.makeInfallible(function(evt) {
|
||||
if (!this._tabActor.attached) {
|
||||
return;
|
||||
}
|
||||
|
||||
// pageshow events for non-persisted pages have already been handled by a
|
||||
// prior DOMWindowCreated event.
|
||||
// prior DOMWindowCreated event. For persisted pages, act as if the window
|
||||
// had just been created since it's been unfrozen from bfcache.
|
||||
if (evt.type == "pageshow" && !evt.persisted) {
|
||||
return;
|
||||
}
|
||||
|
||||
let window = evt.target.defaultView;
|
||||
this._tabActor._windowReady(window);
|
||||
|
||||
if (evt.type !== "pageshow") {
|
||||
this._knownWindowIDs.set(this._getWindowID(window), window);
|
||||
}
|
||||
}, "DebuggerProgressListener.prototype.onWindowCreated"),
|
||||
|
||||
onWindowHidden: DevToolsUtils.makeInfallible(function(evt) {
|
||||
if (!this._tabActor.attached) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Only act as if the window has been destroyed if the 'pagehide' event
|
||||
// was sent for a persisted window (persisted is set when the page is put
|
||||
// and frozen in the bfcache). If the page isn't persisted, the observer's
|
||||
// inner-window-destroyed event will handle it.
|
||||
if (!evt.persisted) {
|
||||
return;
|
||||
}
|
||||
|
||||
let window = evt.target.defaultView;
|
||||
this._tabActor._windowDestroyed(window);
|
||||
}, "DebuggerProgressListener.prototype.onWindowHidden"),
|
||||
|
||||
observe: DevToolsUtils.makeInfallible(function(subject, topic) {
|
||||
if (!this._tabActor.attached) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Because this observer will be called for all inner-window-destroyed in
|
||||
// the application, we need to filter out events for windows we are not
|
||||
// watching
|
||||
let innerID = subject.QueryInterface(Ci.nsISupportsPRUint64).data;
|
||||
let window = this._knownWindowIDs.get(innerID);
|
||||
if (window) {
|
||||
this._knownWindowIDs.delete(innerID);
|
||||
this._tabActor._windowDestroyed(window);
|
||||
}
|
||||
}, "DebuggerProgressListener.prototype.observe"),
|
||||
|
||||
onStateChange:
|
||||
DevToolsUtils.makeInfallible(function DPL_onStateChange(aProgress, aRequest, aFlag, aStatus) {
|
||||
// Ignore any event if the tab actor isn't attached.
|
||||
DevToolsUtils.makeInfallible(function(aProgress, aRequest, aFlag, aStatus) {
|
||||
if (!this._tabActor.attached) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -5,13 +5,22 @@
|
|||
|
||||
let {
|
||||
getLayoutChangesObserver,
|
||||
releaseLayoutChangesObserver
|
||||
releaseLayoutChangesObserver,
|
||||
LayoutChangesObserver
|
||||
} = devtools.require("devtools/server/actors/layout");
|
||||
|
||||
// Override set/clearTimeout on LayoutChangesObserver to avoid depending on
|
||||
// time in this unit test. This means that LayoutChangesObserver.eventLoopTimer
|
||||
// will be the timeout callback instead of the timeout itself, so test cases
|
||||
// will need to execute it to fake a timeout
|
||||
LayoutChangesObserver.prototype._setTimeout = cb => cb;
|
||||
LayoutChangesObserver.prototype._clearTimeout = function() {};
|
||||
|
||||
// Mock the tabActor since we only really want to test the LayoutChangesObserver
|
||||
// and don't want to depend on a window object, nor want to test protocol.js
|
||||
function MockTabActor() {
|
||||
this.window = new MockWindow();
|
||||
this.windows = [this.window];
|
||||
}
|
||||
|
||||
function MockWindow() {}
|
||||
|
@ -22,7 +31,9 @@ MockWindow.prototype = {
|
|||
getInterface: function() {
|
||||
return {
|
||||
QueryInterface: function() {
|
||||
self.docShell = new MockDocShell();
|
||||
if (!self.docShell) {
|
||||
self.docShell = new MockDocShell();
|
||||
}
|
||||
return self.docShell;
|
||||
}
|
||||
};
|
||||
|
@ -91,7 +102,6 @@ function eventsAreBatched() {
|
|||
// Note that in this test, we mock the TabActor and its window property, so we
|
||||
// also mock the setTimeout/clearTimeout mechanism and just call the callback
|
||||
// manually
|
||||
|
||||
let tabActor = new MockTabActor();
|
||||
let observer = getLayoutChangesObserver(tabActor);
|
||||
|
||||
|
|
|
@ -53,7 +53,6 @@ html|applet:not([height]), html|applet[height=""] {
|
|||
word-spacing: initial;
|
||||
letter-spacing: initial;
|
||||
line-height: initial;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* Initialize the overlay with visibility:hidden to prevent flickering if
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
background-color: rgb(72,72,72);
|
||||
color: white;
|
||||
-moz-user-select: none;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.hoverBox {
|
||||
|
@ -168,22 +167,17 @@ html|a {
|
|||
|
||||
.closeIcon {
|
||||
display: block;
|
||||
position: absolute;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
top: 4px;
|
||||
right: 4px;
|
||||
margin-top: 4px;
|
||||
-moz-margin-start: -20px;
|
||||
-moz-margin-end: 4px;
|
||||
border: none;
|
||||
background-color: transparent;
|
||||
background-image: url("chrome://mozapps/skin/plugins/contentPluginClose.png");
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mainBox[chromedir="rtl"] .closeIcon {
|
||||
right: auto;
|
||||
left: 4px;
|
||||
}
|
||||
|
||||
.closeIcon:hover {
|
||||
background-position: -16px 0;
|
||||
}
|
||||
|
|