Bug 1497125 [wpt PR 13414] - Make :host account for its own pseudo-class specificity., a=testonly
authorRune Lillesveen <futhark@chromium.org>
Thu, 11 Oct 2018 09:31:49 +0000
changeset 499490 e9ac63863da9a9b1fa0d3988da3e5b1efb77675d
parent 499489 4d86700418d293e5e4deacf559b76b6cac6ad046
child 499491 a88e4b2e5274eae2857c8e5c0e518f44c836d544
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1497125, 13414, 857415, 1250963, 597549
milestone64.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 1497125 [wpt PR 13414] - Make :host account for its own pseudo-class specificity., a=testonly Automatic update from web-platform-testsMake :host account for its own pseudo-class specificity. Otherwise `:host div` is equally specific to `div`, which seems undesirable and doesn't match any spec. This is only done for Shadow DOM v1 since there are backward compat issues with Polymer and WebUI. Intent to ship: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/gYrR2nR6quI Bug: 857415 Change-Id: Ieaaf9b835ae7136806ced8f6e72fb30f9adf02af Reviewed-on: https://chromium-review.googlesource.com/c/1250963 Commit-Queue: Rune Lillesveen <futhark@chromium.org> Reviewed-by: Emilio Cobos Álvarez <emilio@chromium.org> Cr-Commit-Position: refs/heads/master@{#597549} -- wpt-commits: 5810d070c87063deb718734562e8e2340efacdf1 wpt-pr: 13414
testing/web-platform/tests/css/css-scoping/host-context-specificity-001.html
testing/web-platform/tests/css/css-scoping/host-context-specificity-002.html
testing/web-platform/tests/css/css-scoping/host-context-specificity-003.html
testing/web-platform/tests/css/css-scoping/host-specificity-003.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-scoping/host-context-specificity-001.html
@@ -0,0 +1,21 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>CSS Test: the selector inside :host-context() affects specificity</title>
+<link rel="help" href="https://drafts.csswg.org/css-scoping/#host-selector">
+<link rel="match" href="reference/green-box.html">
+<p>Test passes if you see a single 100px by 100px green box below.</p>
+<div id="host"></div>
+<script>
+  host.attachShadow({ mode: 'open' }).innerHTML = `
+    <style>
+      :host-context(#host) {
+        width: 100px;
+        height: 100px;
+        background: green;
+      }
+      :host {
+        background: red;
+      }
+    </style>
+  `;
+</script>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-scoping/host-context-specificity-002.html
@@ -0,0 +1,23 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>CSS Test: :host-context() is accounted for during specificity computation</title>
+<link rel="help" href="https://drafts.csswg.org/css-scoping/#host-selector">
+<link rel="match" href="reference/green-box.html">
+<p>Test passes if you see a single 100px by 100px green box below.</p>
+<div id="host"></div>
+<script>
+  host.attachShadow({ mode: 'open' }).innerHTML = `
+    <style>
+      .foo span {
+        display: block;
+        width: 100px;
+        height: 100px;
+        background: red;
+      }
+      :host-context(*) span {
+        background: green;
+      }
+    </style>
+    <div class="foo"><span></span></div>
+  `;
+</script>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-scoping/host-context-specificity-003.html
@@ -0,0 +1,22 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>CSS Test: the :host-context() selector affects specificity</title>
+<link rel="help" href="https://drafts.csswg.org/css-scoping/#host-selector">
+<link rel="match" href="reference/green-box.html">
+<p>Test passes if you see a single 100px by 100px green box below.</p>
+<div id="host"></div>
+<script>
+  host.attachShadow({ mode: 'open' }).innerHTML = `
+    <style>
+      :host-context(*) div {
+        width: 100px;
+        height: 100px;
+        background: green;
+      }
+      div {
+        background: red;
+      }
+    </style>
+    <div></div>
+  `;
+</script>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-scoping/host-specificity-003.html
@@ -0,0 +1,26 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>CSS Test: the :host() selector affects specificity</title>
+<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
+<link rel="author" title="Mozilla" href="https://mozilla.org">
+<link rel="help" href="https://drafts.csswg.org/css-scoping/#host-selector">
+<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/1915">
+<link rel="help" href="https://bugzil.la/1454165">
+<link rel="match" href="reference/green-box.html">
+<p>Test passes if you see a single 100px by 100px green box below.</p>
+<div id="host"></div>
+<script>
+  host.attachShadow({ mode: 'open' }).innerHTML = `
+    <style>
+      :host(*) div {
+        width: 100px;
+        height: 100px;
+        background: green;
+      }
+      div {
+        background: red;
+      }
+    </style>
+    <div></div>
+  `;
+</script>