Bug 1468127: Move slot UA rule to html.css. r=xidorn
authorEmilio Cobos Álvarez <emilio@crisal.io>
Mon, 11 Jun 2018 03:26:57 +0200
changeset 476846 0f848f76f6e75bd99e3d56f5fff046efb516d2a0
parent 476845 9ca74dd454400190188c6646cf94441f198bbc24
child 476847 dc997a4e045ec9c83288466a013a029cc475603c
push id9374
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:43:20 +0000
treeherdermozilla-beta@160e085dfb0b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersxidorn
bugs1468127
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1468127: Move slot UA rule to html.css. r=xidorn MozReview-Commit-ID: FRBioGS4Gbe
layout/style/res/html.css
layout/style/res/ua.css
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/css/css-scoping/slot-non-html-display-value.html
--- a/layout/style/res/html.css
+++ b/layout/style/res/html.css
@@ -898,8 +898,14 @@ rtc:lang(zh-TW), rt:lang(zh-TW) {
   -moz-min-font-size-ratio: 30%;
 }
 rtc > rt {
   font-size: inherit;
 }
 ruby, rb, rt, rtc {
   unicode-bidi: isolate;
 }
+
+/* Shadow DOM v1
+ * https://drafts.csswg.org/css-scoping/#slots-in-shadow-tree */
+slot {
+  display: contents;
+}
--- a/layout/style/res/ua.css
+++ b/layout/style/res/ua.css
@@ -480,14 +480,8 @@ div:-moz-native-anonymous.moz-custom-con
   pointer-events: none;
   -moz-top-layer: top;
   position: absolute;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
 }
-
-/* Shadow DOM v1
- * https://drafts.csswg.org/css-scoping/#slots-in-shadow-tree */
-slot {
-  display: contents;
-}
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -317921,16 +317921,22 @@
     ]
    ],
    "css/css-scoping/shadow-cascade-order-001.html": [
     [
      "/css/css-scoping/shadow-cascade-order-001.html",
      {}
     ]
    ],
+   "css/css-scoping/slot-non-html-display-value.html": [
+    [
+     "/css/css-scoping/slot-non-html-display-value.html",
+     {}
+    ]
+   ],
    "css/css-scoping/slotted-invalidation.html": [
     [
      "/css/css-scoping/slotted-invalidation.html",
      {}
     ]
    ],
    "css/css-scoping/slotted-link.html": [
     [
@@ -522958,16 +522964,20 @@
   "css/css-scoping/shadow-reassign-dynamic-002.html": [
    "2a90e0623a99cfb46430f0236ceea44f93a25131",
    "reftest"
   ],
   "css/css-scoping/shadow-root-insert-into-document.html": [
    "2cee9fff35c9222074f4ef78dcfcb8a3e02bbc98",
    "reftest"
   ],
+  "css/css-scoping/slot-non-html-display-value.html": [
+   "e5d57d25feeccd376116a527c401d570ec1ac1b4",
+   "testharness"
+  ],
   "css/css-scoping/slotted-invalidation.html": [
    "c500e1ceba1b293d45df5f66fd89d4a5d9ceb952",
    "testharness"
   ],
   "css/css-scoping/slotted-link.html": [
    "3e1eb6676da866393e6963f0a44377ea3967c0b9",
    "testharness"
   ],
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-scoping/slot-non-html-display-value.html
@@ -0,0 +1,18 @@
+<!doctype html>
+<title>CSS Test: non-HTML slot elements don't get display: contents by default.</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
+<link rel="help" href="https://drafts.csswg.org/css-scoping/#slots-in-shadow-tree">
+<link rel="help" href="https://bugzil.la/1468127">
+<body>
+<script>
+test(function() {
+  const non_html_slot = document.createElementNS("http://www.w3.org/2000/svg", "slot");
+  document.body.appendChild(non_html_slot);
+  const display = getComputedStyle(non_html_slot).display;
+  // contents would get turned to "none" due to https://drafts.csswg.org/css-display/#unbox-svg
+  assert_true(display != "contents" && display != "none");
+}, "Non-HTML slot elements shouldn't be display: contents by default.");
+</script>
+</body>