From 250dff6fa5c5597f27401adab9d7f1d16b3f1487 Mon Sep 17 00:00:00 2001 From: Myk Melez Date: Thu, 4 Jan 2018 23:43:32 -0800 Subject: [PATCH 01/43] Bug 1428093 - remove left/right margins around subdialog buttons on Mac; r=jaws MozReview-Commit-ID: DE7ARmJTErE --- browser/themes/linux/preferences/preferences.css | 10 ---------- browser/themes/osx/preferences/preferences.css | 5 ----- browser/themes/shared/incontentprefs/dialog.inc.css | 4 ++++ browser/themes/windows/preferences/preferences.css | 10 ---------- 4 files changed, 4 insertions(+), 25 deletions(-) diff --git a/browser/themes/linux/preferences/preferences.css b/browser/themes/linux/preferences/preferences.css index 99f0270ae6f1..0f9c82f866df 100644 --- a/browser/themes/linux/preferences/preferences.css +++ b/browser/themes/linux/preferences/preferences.css @@ -22,16 +22,6 @@ padding: 0px; } -.dialog-button-box { - padding-bottom: 8px; - padding-inline-start: 8px; - padding-inline-end: 8px; -} - -.prefwindow[type="child"] .dialog-button-box { - padding: 0px; -} - /* General Pane */ #useFirefoxSync, #getStarted { diff --git a/browser/themes/osx/preferences/preferences.css b/browser/themes/osx/preferences/preferences.css index d4716c7c1d4d..7391345425f2 100644 --- a/browser/themes/osx/preferences/preferences.css +++ b/browser/themes/osx/preferences/preferences.css @@ -24,11 +24,6 @@ padding-inline-end: 20px; } -.dialog-button-box { - margin: 0 12px 12px; - padding-top: 0 !important; -} - description { margin-bottom: 4px !important; } diff --git a/browser/themes/shared/incontentprefs/dialog.inc.css b/browser/themes/shared/incontentprefs/dialog.inc.css index 56f59f0c4b59..551d44024271 100644 --- a/browser/themes/shared/incontentprefs/dialog.inc.css +++ b/browser/themes/shared/incontentprefs/dialog.inc.css @@ -68,3 +68,7 @@ groupbox description { menulist label { font-weight: unset; } + +.dialog-button-box { + padding: 0; +} diff --git a/browser/themes/windows/preferences/preferences.css b/browser/themes/windows/preferences/preferences.css index 5337c88795a5..967d78134dde 100644 --- a/browser/themes/windows/preferences/preferences.css +++ b/browser/themes/windows/preferences/preferences.css @@ -28,16 +28,6 @@ padding: 0px; } -.dialog-button-box { - padding-bottom: 10px; - padding-inline-start: 8px; - padding-inline-end: 10px; -} - -.prefwindow[type="child"] .dialog-button-box { - padding: 0px; -} - /* General Pane */ #useFirefoxSync, From 956db64844fd174143fd4c0da25d801d6aaeabb8 Mon Sep 17 00:00:00 2001 From: Jessica Jong Date: Fri, 5 Jan 2018 16:17:38 +0800 Subject: [PATCH 02/43] Bug 1398981 - Turn off webcomponents pref by default when running tests. r=smaug --- accessible/tests/mochitest/elm/a11y.ini | 1 + .../tests/mochitest/elm/test_shadowroot.html | 43 +--- .../elm/test_shadowroot_subframe.html | 43 ++++ accessible/tests/mochitest/hittest/a11y.ini | 1 + .../mochitest/hittest/test_shadowroot.html | 56 +---- .../hittest/test_shadowroot_subframe.html | 58 +++++ .../tests/mochitest/treeupdate/a11y.ini | 1 + .../mochitest/treeupdate/test_bug1276857.html | 68 +++--- .../treeupdate/test_bug1276857_subframe.html | 33 +++ dom/base/test/mochitest.ini | 1 + dom/base/test/test_bug1025933.html | 28 ++- dom/base/test/test_bug1037687.html | 59 ++--- dom/base/test/test_bug1037687_subframe.html | 47 ++++ dom/events/test/test_bug1079236.html | 64 ++--- dom/events/test/test_bug1145910.html | 46 ++-- dom/events/test/test_bug1150308.html | 38 ++- dom/events/test/test_bug1264380.html | 42 ++-- .../mochitest/general/test_interfaces.js | 4 +- dom/tests/mochitest/webcomponents/head.js | 30 +++ .../mochitest/webcomponents/mochitest.ini | 3 +- .../webcomponents/test_bug1176757.html | 28 ++- .../webcomponents/test_bug1269155.html | 112 ++++----- .../webcomponents/test_content_element.html | 131 ---------- .../test_custom_element_in_shadow.html | 155 ++++++------ .../webcomponents/test_detached_style.html | 24 +- .../test_document_adoptnode.html | 24 +- .../test_document_importnode.html | 25 +- .../webcomponents/test_event_retarget.html | 224 +++++++++--------- .../webcomponents/test_event_stopping.html | 218 ++++++++--------- .../webcomponents/test_shadowroot.html | 124 +++++----- .../test_shadowroot_inert_element.html | 51 ++-- .../webcomponents/test_shadowroot_style.html | 119 +++++----- .../test_shadowroot_style_order.html | 52 ++-- .../test_style_fallback_content.html | 31 ++- testing/profiles/prefs_general.js | 2 +- .../background-size-027.html.ini | 3 + .../meta/css/css-scoping/__dir__.ini | 2 + .../meta/css/selectors/__dir__.ini | 2 + .../custom-elements/adopted-callback.html.ini | 3 + .../shadow-content.html.ini | 3 + 40 files changed, 1079 insertions(+), 920 deletions(-) create mode 100644 accessible/tests/mochitest/elm/test_shadowroot_subframe.html create mode 100644 accessible/tests/mochitest/hittest/test_shadowroot_subframe.html create mode 100644 accessible/tests/mochitest/treeupdate/test_bug1276857_subframe.html create mode 100644 dom/base/test/test_bug1037687_subframe.html create mode 100644 dom/tests/mochitest/webcomponents/head.js delete mode 100644 dom/tests/mochitest/webcomponents/test_content_element.html create mode 100644 testing/web-platform/meta/css/css-backgrounds/background-size-027.html.ini create mode 100644 testing/web-platform/meta/css/css-scoping/__dir__.ini create mode 100644 testing/web-platform/meta/css/selectors/__dir__.ini create mode 100644 testing/web-platform/meta/custom-elements/adopted-callback.html.ini create mode 100644 testing/web-platform/meta/intersection-observer/shadow-content.html.ini diff --git a/accessible/tests/mochitest/elm/a11y.ini b/accessible/tests/mochitest/elm/a11y.ini index 987bfdb65883..35df3a0eb2b1 100644 --- a/accessible/tests/mochitest/elm/a11y.ini +++ b/accessible/tests/mochitest/elm/a11y.ini @@ -15,3 +15,4 @@ skip-if = buildapp == 'mulet' [test_canvas.html] [test_shadowroot.html] skip-if = stylo # bug 1293844 +support-files = test_shadowroot_subframe.html diff --git a/accessible/tests/mochitest/elm/test_shadowroot.html b/accessible/tests/mochitest/elm/test_shadowroot.html index f46a1333afdd..d5f05d263c37 100644 --- a/accessible/tests/mochitest/elm/test_shadowroot.html +++ b/accessible/tests/mochitest/elm/test_shadowroot.html @@ -8,31 +8,6 @@ - - - - @@ -46,13 +21,19 @@
   
-
diff --git a/accessible/tests/mochitest/elm/test_shadowroot_subframe.html b/accessible/tests/mochitest/elm/test_shadowroot_subframe.html new file mode 100644 index 000000000000..aaf30324d816 --- /dev/null +++ b/accessible/tests/mochitest/elm/test_shadowroot_subframe.html @@ -0,0 +1,43 @@ + + + + ShadowRoot tests + + + + + + + + +
+ + diff --git a/accessible/tests/mochitest/hittest/a11y.ini b/accessible/tests/mochitest/hittest/a11y.ini index 13bca54de2d8..ca79008639fc 100644 --- a/accessible/tests/mochitest/hittest/a11y.ini +++ b/accessible/tests/mochitest/hittest/a11y.ini @@ -9,6 +9,7 @@ skip-if = (os == "android" || appname == "b2g") [test_general.html] [test_menu.xul] [test_shadowroot.html] +support-files = test_shadowroot_subframe.html [test_zoom.html] [test_zoom_text.html] [test_zoom_tree.xul] diff --git a/accessible/tests/mochitest/hittest/test_shadowroot.html b/accessible/tests/mochitest/hittest/test_shadowroot.html index 95d9153b92c3..4cb4e9bea64a 100644 --- a/accessible/tests/mochitest/hittest/test_shadowroot.html +++ b/accessible/tests/mochitest/hittest/test_shadowroot.html @@ -8,26 +8,6 @@ - - - - @@ -41,31 +21,19 @@
   
-
- -
-
- -
diff --git a/accessible/tests/mochitest/hittest/test_shadowroot_subframe.html b/accessible/tests/mochitest/hittest/test_shadowroot_subframe.html new file mode 100644 index 000000000000..7a365e7b931b --- /dev/null +++ b/accessible/tests/mochitest/hittest/test_shadowroot_subframe.html @@ -0,0 +1,58 @@ + + + + ShadowRoot hit tests + + + + + + + + +
+ +
+
+ +
+ + + diff --git a/accessible/tests/mochitest/treeupdate/a11y.ini b/accessible/tests/mochitest/treeupdate/a11y.ini index d725ebff339a..503cb4155dba 100644 --- a/accessible/tests/mochitest/treeupdate/a11y.ini +++ b/accessible/tests/mochitest/treeupdate/a11y.ini @@ -15,6 +15,7 @@ support-files = [test_bug1175913.html] [test_bug1189277.html] [test_bug1276857.html] +support-files = test_bug1276857_subframe.html [test_canvas.html] [test_colorpicker.xul] [test_contextmenu.xul] diff --git a/accessible/tests/mochitest/treeupdate/test_bug1276857.html b/accessible/tests/mochitest/treeupdate/test_bug1276857.html index 30d267330d5a..7617ba17eb68 100644 --- a/accessible/tests/mochitest/treeupdate/test_bug1276857.html +++ b/accessible/tests/mochitest/treeupdate/test_bug1276857.html @@ -18,9 +18,14 @@ - -

- -
-  
- -
- -
- - - -
- - diff --git a/accessible/tests/mochitest/treeupdate/test_bug1276857_subframe.html b/accessible/tests/mochitest/treeupdate/test_bug1276857_subframe.html new file mode 100644 index 000000000000..869c9ebe6c20 --- /dev/null +++ b/accessible/tests/mochitest/treeupdate/test_bug1276857_subframe.html @@ -0,0 +1,33 @@ + + + + DOM mutations test + + + + +
+ +
+ + + +
+ + + + diff --git a/dom/base/test/mochitest.ini b/dom/base/test/mochitest.ini index 0d52b6e9da5c..1488498a0aab 100644 --- a/dom/base/test/mochitest.ini +++ b/dom/base/test/mochitest.ini @@ -579,6 +579,7 @@ skip-if = toolkit == 'android' #bug 687032 skip-if = stylo # bug 1293844 [test_bug1037687.html] skip-if = stylo # bug 1293844 +support-files = test_bug1037687_subframe.html [test_bug1043106.html] [test_bug1057176.html] [test_bug1060938.html] diff --git a/dom/base/test/test_bug1025933.html b/dom/base/test/test_bug1025933.html index b48fbf3ef47d..4f8f87e07a63 100644 --- a/dom/base/test/test_bug1025933.html +++ b/dom/base/test/test_bug1025933.html @@ -15,12 +15,25 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1025933 SimpleTest.waitForExplicitFinish(); function test() { - var s = document.getElementById("host").createShadowRoot(); - s.innerHTML = '
'; - var el = s.firstElementChild; - is(el.clientWidth, 100); - is(el.clientHeight, 100); - SimpleTest.finish(); + SpecialPowers.pushPrefEnv({ + set: [ + ["dom.webcomponents.enabled", true] + ] + }, function() { + var iframe = document.createElement('iframe'); + iframe.srcdoc = '
'; + + iframe.onload = function() { + var s = iframe.contentDocument.getElementById("host").attachShadow({mode: 'open'}); + s.innerHTML = '
'; + var el = s.firstElementChild; + is(el.clientWidth, 100); + is(el.clientHeight, 100); + SimpleTest.finish(); + } + + document.body.appendChild(iframe); + }); } @@ -28,9 +41,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1025933 Mozilla Bug 1025933

-
-
-
 
diff --git a/dom/base/test/test_bug1037687.html b/dom/base/test/test_bug1037687.html index 097a3d1e6ee5..3ff96d5b51a4 100644 --- a/dom/base/test/test_bug1037687.html +++ b/dom/base/test/test_bug1037687.html @@ -8,49 +8,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1037687 Test for Bug 1037687 - - + Mozilla Bug 1037687

 
-
+ diff --git a/dom/base/test/test_bug1037687_subframe.html b/dom/base/test/test_bug1037687_subframe.html new file mode 100644 index 000000000000..141cddaa5a25 --- /dev/null +++ b/dom/base/test/test_bug1037687_subframe.html @@ -0,0 +1,47 @@ + + + + + + +
+ + diff --git a/dom/events/test/test_bug1079236.html b/dom/events/test/test_bug1079236.html index 7957823e604a..b13cdc19b3b0 100644 --- a/dom/events/test/test_bug1079236.html +++ b/dom/events/test/test_bug1079236.html @@ -13,38 +13,48 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1079236 /** Test for Bug 1079236 **/ -SimpleTest.waitForExplicitFinish(); -SimpleTest.waitForFocus(runTests); + function runTests() { + var iframe = document.createElement('iframe'); + document.body.appendChild(iframe); + iframe.contentDocument.body.innerHTML = '
'; -function runTests() { - var c = document.getElementById("content"); - var sr = c.createShadowRoot(); - sr.innerHTML = ""; - var file = sr.firstChild; - is(file.type, "file"); - file.offsetLeft; // Flush layout because dispatching mouse events. - document.body.onmousemove = function(e) { - is(e.target, c, "Event target should be the element in non-Shadow DOM"); - if (e.originalTarget == file) { - is(e.originalTarget, file, - "type='file' implementation doesn't seem to have native anonymous content"); - } else { - var wrapped = SpecialPowers.wrap(e.originalTarget); - isnot(wrapped, file, "Shouldn't have the same event.target and event.originalTarget"); + var c = iframe.contentDocument.getElementById("content"); + var sr = c.attachShadow({mode: 'open'}); + sr.innerHTML = ""; + var file = sr.firstChild; + is(file.type, "file"); + file.offsetLeft; // Flush layout because dispatching mouse events. + iframe.contentDocument.body.onmousemove = function(e) { + is(e.target, c, "Event target should be the element in non-Shadow DOM"); + if (e.originalTarget == file) { + is(e.originalTarget, file, + "type='file' implementation doesn't seem to have native anonymous content"); + } else { + var wrapped = SpecialPowers.wrap(e.originalTarget); + isnot(wrapped, file, "Shouldn't have the same event.target and event.originalTarget"); + } + + ok(!("composedTarget" in e), "Events shouldn't have composedTarget in non-chrome context!"); + e = SpecialPowers.wrap(e); + var composedTarget = SpecialPowers.unwrap(e.composedTarget); + ok(composedTarget, file, "composedTarget should be the file object."); + + SimpleTest.finish(); } - ok(!("composedTarget" in e), "Events shouldn't have composedTarget in non-chrome context!"); - e = SpecialPowers.wrap(e); - var composedTarget = SpecialPowers.unwrap(e.composedTarget); - ok(composedTarget, file, "composedTarget should be the file object."); - - SimpleTest.finish(); + var r = file.getBoundingClientRect(); + synthesizeMouse(file, r.width / 6, r.height / 2, { type: "mousemove"}, iframe.contentWindow); + iframe.contentDocument.body.onmousemove = null; } - var r = file.getBoundingClientRect(); - synthesizeMouse(file, r.width / 6, r.height / 2, { type: "mousemove"} ); - document.body.onmousemove = null; -} + SimpleTest.waitForExplicitFinish(); + SimpleTest.waitForFocus(() => { + SpecialPowers.pushPrefEnv({ + set: [ + ["dom.webcomponents.enabled", true] + ] + }, runTests); + }); diff --git a/dom/events/test/test_bug1145910.html b/dom/events/test/test_bug1145910.html index b87104eb5159..2dec7eeb22d9 100644 --- a/dom/events/test/test_bug1145910.html +++ b/dom/events/test/test_bug1145910.html @@ -10,37 +10,47 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1145910 - -
Foo
+ diff --git a/dom/events/test/test_bug1150308.html b/dom/events/test/test_bug1150308.html index c90e1055c322..f1392cd3fbf1 100644 --- a/dom/events/test/test_bug1150308.html +++ b/dom/events/test/test_bug1150308.html @@ -10,32 +10,44 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1150308 -
Foo
diff --git a/dom/events/test/test_bug1264380.html b/dom/events/test/test_bug1264380.html index 76b9fb46b35f..f5814394be3e 100644 --- a/dom/events/test/test_bug1264380.html +++ b/dom/events/test/test_bug1264380.html @@ -6,20 +6,21 @@ - -
+ diff --git a/dom/tests/mochitest/general/test_interfaces.js b/dom/tests/mochitest/general/test_interfaces.js index bcdd45153b0b..56979977fd87 100644 --- a/dom/tests/mochitest/general/test_interfaces.js +++ b/dom/tests/mochitest/general/test_interfaces.js @@ -507,7 +507,7 @@ var interfaceNamesInGlobalScope = // IMPORTANT: Do not change this list without review from a DOM peer! "HTMLSelectElement", // IMPORTANT: Do not change this list without review from a DOM peer! - "HTMLSlotElement", + {name: "HTMLSlotElement", disabled: true}, // IMPORTANT: Do not change this list without review from a DOM peer! "HTMLSourceElement", // IMPORTANT: Do not change this list without review from a DOM peer! @@ -843,7 +843,7 @@ var interfaceNamesInGlobalScope = // IMPORTANT: Do not change this list without review from a DOM peer! {name: "ScopedCredentialInfo", disabled: true}, // IMPORTANT: Do not change this list without review from a DOM peer! - "ShadowRoot", // Bogus, but the test harness forces it on. See bug 1159768. + {name: "ShadowRoot", disabled: true}, // IMPORTANT: Do not change this list without review from a DOM peer! "SharedWorker", // IMPORTANT: Do not change this list without review from a DOM peer! diff --git a/dom/tests/mochitest/webcomponents/head.js b/dom/tests/mochitest/webcomponents/head.js new file mode 100644 index 000000000000..21597711a2dd --- /dev/null +++ b/dom/tests/mochitest/webcomponents/head.js @@ -0,0 +1,30 @@ +/* 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 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +/** + * Set dom.webcomponents.enabled pref to true and loads an iframe, to ensure + * that the Element instance is loaded with the correct value of the + * preference. + * + * @return {Promise} promise that resolves when iframe is loaded. + */ +function setWebComponentsPrefAndCreateIframe(aSrcDoc) { + return new Promise(function (aResolve, aReject) { + SpecialPowers.pushPrefEnv({ + set: [ + ["dom.webcomponents.enabled", true] + ] + }, () => { + let iframe = document.createElement("iframe"); + iframe.onload = function () { aResolve(iframe.contentDocument); } + iframe.onerror = function () { aReject('Failed to load iframe'); } + if (aSrcDoc) { + iframe.srcdoc = aSrcDoc; + } + document.body.appendChild(iframe); + }); + }); +} diff --git a/dom/tests/mochitest/webcomponents/mochitest.ini b/dom/tests/mochitest/webcomponents/mochitest.ini index 876477f82799..fb1f083f74f3 100644 --- a/dom/tests/mochitest/webcomponents/mochitest.ini +++ b/dom/tests/mochitest/webcomponents/mochitest.ini @@ -2,13 +2,12 @@ support-files = inert_style.css dummy_page.html + head.js [test_bug900724.html] [test_bug1017896.html] [test_bug1176757.html] [test_bug1276240.html] -[test_content_element.html] -skip-if = true # Triggers assertions about flattened tree inconsistencies and it's going away in bug 1418002. [test_custom_element_callback_innerhtml.html] [test_custom_element_htmlconstructor.html] skip-if = os == 'android' # bug 1323645 diff --git a/dom/tests/mochitest/webcomponents/test_bug1176757.html b/dom/tests/mochitest/webcomponents/test_bug1176757.html index 57a7a73b7697..39d949fcece9 100644 --- a/dom/tests/mochitest/webcomponents/test_bug1176757.html +++ b/dom/tests/mochitest/webcomponents/test_bug1176757.html @@ -5,13 +5,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1176757 --> Test for Bug 1176757 + Mozilla Bug 1176757 + href="https://bugzilla.mozilla.org/show_bug.cgi?id=1176757">Mozilla Bug 1176757