Import W3C CSS WG tests for shadow DOM
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Apr 2016 08:09:36 +0000 (08:09 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Apr 2016 08:09:36 +0000 (08:09 +0000)
https://bugs.webkit.org/show_bug.cgi?id=157063

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

Imported CSS WG's Scoping Level 1 tests from https://github.com/w3c/csswg-test
as of b2daa426addd5ccb8e9ce1c5d800f9d82603f1ec. Most of these tests are actually ours
except shadow-cascade-order-001.html.

* csswg-test: Added.
* csswg-test/css-scoping-1: Added.
* csswg-test/css-scoping-1/css-scoping-shadow-assigned-node-with-before-after-expected.html: Added.
* csswg-test/css-scoping-1/css-scoping-shadow-assigned-node-with-before-after.html: Added.
* csswg-test/css-scoping-1/css-scoping-shadow-assigned-node-with-rules-expected.html: Added.
* csswg-test/css-scoping-1/css-scoping-shadow-assigned-node-with-rules.html: Added.
* csswg-test/css-scoping-1/css-scoping-shadow-host-functional-rule-expected.html: Added.
* csswg-test/css-scoping-1/css-scoping-shadow-host-functional-rule.html: Added.
* csswg-test/css-scoping-1/css-scoping-shadow-host-rule-expected.html: Added.
* csswg-test/css-scoping-1/css-scoping-shadow-host-rule.html: Added.
* csswg-test/css-scoping-1/css-scoping-shadow-host-with-before-after-expected.html: Added.
* csswg-test/css-scoping-1/css-scoping-shadow-host-with-before-after.html: Added.
* csswg-test/css-scoping-1/css-scoping-shadow-invisible-slot-expected.html: Added.
* csswg-test/css-scoping-1/css-scoping-shadow-invisible-slot.html: Added.
* csswg-test/css-scoping-1/css-scoping-shadow-root-hides-children-expected.html: Added.
* csswg-test/css-scoping-1/css-scoping-shadow-root-hides-children.html: Added.
* csswg-test/css-scoping-1/css-scoping-shadow-slot-display-override-expected.html: Added.
* csswg-test/css-scoping-1/css-scoping-shadow-slot-display-override.html: Added.
* csswg-test/css-scoping-1/css-scoping-shadow-slot-expected.html: Added.
* csswg-test/css-scoping-1/css-scoping-shadow-slot-fallback-expected.html: Added.
* csswg-test/css-scoping-1/css-scoping-shadow-slot-fallback.html: Added.
* csswg-test/css-scoping-1/css-scoping-shadow-slot.html: Added.
* csswg-test/css-scoping-1/css-scoping-shadow-slotted-nested-expected.html: Added.
* csswg-test/css-scoping-1/css-scoping-shadow-slotted-nested.html: Added.
* csswg-test/css-scoping-1/css-scoping-shadow-slotted-rule-expected.html: Added.
* csswg-test/css-scoping-1/css-scoping-shadow-slotted-rule.html: Added.
* csswg-test/css-scoping-1/css-scoping-shadow-with-outside-rules-expected.html: Added.
* csswg-test/css-scoping-1/css-scoping-shadow-with-outside-rules.html: Added.
* csswg-test/css-scoping-1/css-scoping-shadow-with-rules-expected.html: Added.
* csswg-test/css-scoping-1/css-scoping-shadow-with-rules-no-style-leak-expected.html: Added.
* csswg-test/css-scoping-1/css-scoping-shadow-with-rules-no-style-leak.html: Added.
* csswg-test/css-scoping-1/css-scoping-shadow-with-rules.html: Added.
* csswg-test/css-scoping-1/shadow-cascade-order-001-expected.txt: Added.
* csswg-test/css-scoping-1/shadow-cascade-order-001.html: Added.
* csswg-test/css-scoping-1/w3c-import.log: Added.

LayoutTests:

Remove tests that have been upstreamed and imported under imported/w3c/csswg-test/css-scoping-1.

* fast/shadow-dom/css-scoping-shadow-assigned-node-with-before-after-expected.html: Removed.
* fast/shadow-dom/css-scoping-shadow-assigned-node-with-before-after.html: Removed.
* fast/shadow-dom/css-scoping-shadow-assigned-node-with-rules-expected.html: Removed.
* fast/shadow-dom/css-scoping-shadow-assigned-node-with-rules.html: Removed.
* fast/shadow-dom/css-scoping-shadow-host-functional-rule-expected.html: Removed.
* fast/shadow-dom/css-scoping-shadow-host-functional-rule.html: Removed.
* fast/shadow-dom/css-scoping-shadow-host-rule-expected.html: Removed.
* fast/shadow-dom/css-scoping-shadow-host-rule.html: Removed.
* fast/shadow-dom/css-scoping-shadow-host-with-before-after-expected.html: Removed.
* fast/shadow-dom/css-scoping-shadow-host-with-before-after.html: Removed.
* fast/shadow-dom/css-scoping-shadow-invisible-slot-expected.html: Removed.
* fast/shadow-dom/css-scoping-shadow-invisible-slot.html: Removed.
* fast/shadow-dom/css-scoping-shadow-root-hides-children-expected.html: Removed.
* fast/shadow-dom/css-scoping-shadow-root-hides-children.html: Removed.
* fast/shadow-dom/css-scoping-shadow-slot-display-override-expected.html: Removed.
* fast/shadow-dom/css-scoping-shadow-slot-display-override.html: Removed.
* fast/shadow-dom/css-scoping-shadow-slot-expected.html: Removed.
* fast/shadow-dom/css-scoping-shadow-slot-fallback-expected.html: Removed.
* fast/shadow-dom/css-scoping-shadow-slot-fallback.html: Removed.
* fast/shadow-dom/css-scoping-shadow-slot.html: Removed.
* fast/shadow-dom/css-scoping-shadow-slotted-nested-expected.html: Removed.
* fast/shadow-dom/css-scoping-shadow-slotted-nested.html: Removed.
* fast/shadow-dom/css-scoping-shadow-slotted-rule-expected.html: Removed.
* fast/shadow-dom/css-scoping-shadow-slotted-rule.html: Removed.
* fast/shadow-dom/css-scoping-shadow-with-outside-rules-expected.html: Removed.
* fast/shadow-dom/css-scoping-shadow-with-outside-rules.html: Removed.
* fast/shadow-dom/css-scoping-shadow-with-rules-expected.html: Removed.
* fast/shadow-dom/css-scoping-shadow-with-rules-no-style-leak-expected.html: Removed.
* fast/shadow-dom/css-scoping-shadow-with-rules-no-style-leak.html: Removed.
* fast/shadow-dom/css-scoping-shadow-with-rules.html: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200234 268f45cc-cd09-0410-ab3c-d52691b4dbfc

36 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/shadow-dom/css-scoping-shadow-host-functional-rule.html [deleted file]
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-assigned-node-with-before-after-expected.html [moved from LayoutTests/fast/shadow-dom/css-scoping-shadow-assigned-node-with-before-after-expected.html with 54% similarity]
LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-assigned-node-with-before-after.html [moved from LayoutTests/fast/shadow-dom/css-scoping-shadow-assigned-node-with-before-after.html with 81% similarity]
LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-assigned-node-with-rules-expected.html [moved from LayoutTests/fast/shadow-dom/css-scoping-shadow-assigned-node-with-rules-expected.html with 54% similarity]
LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-assigned-node-with-rules.html [moved from LayoutTests/fast/shadow-dom/css-scoping-shadow-assigned-node-with-rules.html with 89% similarity]
LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-host-functional-rule-expected.html [moved from LayoutTests/fast/shadow-dom/css-scoping-shadow-host-functional-rule-expected.html with 54% similarity]
LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-host-functional-rule.html [new file with mode: 0644]
LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-host-rule-expected.html [moved from LayoutTests/fast/shadow-dom/css-scoping-shadow-host-rule-expected.html with 54% similarity]
LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-host-rule.html [moved from LayoutTests/fast/shadow-dom/css-scoping-shadow-host-rule.html with 92% similarity]
LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-host-with-before-after-expected.html [moved from LayoutTests/fast/shadow-dom/css-scoping-shadow-host-with-before-after-expected.html with 54% similarity]
LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-host-with-before-after.html [moved from LayoutTests/fast/shadow-dom/css-scoping-shadow-host-with-before-after.html with 87% similarity]
LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-invisible-slot-expected.html [moved from LayoutTests/fast/shadow-dom/css-scoping-shadow-invisible-slot-expected.html with 54% similarity]
LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-invisible-slot.html [moved from LayoutTests/fast/shadow-dom/css-scoping-shadow-invisible-slot.html with 89% similarity]
LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-root-hides-children-expected.html [moved from LayoutTests/fast/shadow-dom/css-scoping-shadow-root-hides-children-expected.html with 54% similarity]
LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-root-hides-children.html [moved from LayoutTests/fast/shadow-dom/css-scoping-shadow-root-hides-children.html with 90% similarity]
LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slot-display-override-expected.html [moved from LayoutTests/fast/shadow-dom/css-scoping-shadow-slot-display-override-expected.html with 54% similarity]
LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slot-display-override.html [moved from LayoutTests/fast/shadow-dom/css-scoping-shadow-slot-display-override.html with 90% similarity]
LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slot-expected.html [moved from LayoutTests/fast/shadow-dom/css-scoping-shadow-slot-expected.html with 54% similarity]
LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slot-fallback-expected.html [moved from LayoutTests/fast/shadow-dom/css-scoping-shadow-slot-fallback-expected.html with 54% similarity]
LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slot-fallback.html [moved from LayoutTests/fast/shadow-dom/css-scoping-shadow-slot-fallback.html with 84% similarity]
LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slot.html [moved from LayoutTests/fast/shadow-dom/css-scoping-shadow-slot.html with 89% similarity]
LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slotted-nested-expected.html [moved from LayoutTests/fast/shadow-dom/css-scoping-shadow-slotted-nested-expected.html with 54% similarity]
LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slotted-nested.html [moved from LayoutTests/fast/shadow-dom/css-scoping-shadow-slotted-nested.html with 93% similarity]
LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slotted-rule-expected.html [moved from LayoutTests/fast/shadow-dom/css-scoping-shadow-slotted-rule-expected.html with 54% similarity]
LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slotted-rule.html [moved from LayoutTests/fast/shadow-dom/css-scoping-shadow-slotted-rule.html with 92% similarity]
LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-with-outside-rules-expected.html [moved from LayoutTests/fast/shadow-dom/css-scoping-shadow-with-outside-rules-expected.html with 54% similarity]
LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-with-outside-rules.html [moved from LayoutTests/fast/shadow-dom/css-scoping-shadow-with-outside-rules.html with 89% similarity]
LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-with-rules-expected.html [moved from LayoutTests/fast/shadow-dom/css-scoping-shadow-with-rules-expected.html with 54% similarity]
LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-with-rules-no-style-leak-expected.html [moved from LayoutTests/fast/shadow-dom/css-scoping-shadow-with-rules-no-style-leak-expected.html with 54% similarity]
LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-with-rules-no-style-leak.html [moved from LayoutTests/fast/shadow-dom/css-scoping-shadow-with-rules-no-style-leak.html with 89% similarity]
LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-with-rules.html [moved from LayoutTests/fast/shadow-dom/css-scoping-shadow-with-rules.html with 88% similarity]
LayoutTests/imported/w3c/csswg-test/css-scoping-1/shadow-cascade-order-001-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/csswg-test/css-scoping-1/shadow-cascade-order-001.html [new file with mode: 0644]
LayoutTests/imported/w3c/csswg-test/css-scoping-1/w3c-import.log [new file with mode: 0644]

index a5543a6..b4f26c9 100644 (file)
@@ -1,3 +1,43 @@
+2016-04-29  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Import W3C CSS WG tests for shadow DOM
+        https://bugs.webkit.org/show_bug.cgi?id=157063
+
+        Reviewed by Antti Koivisto.
+
+        Remove tests that have been upstreamed and imported under imported/w3c/csswg-test/css-scoping-1.
+
+        * fast/shadow-dom/css-scoping-shadow-assigned-node-with-before-after-expected.html: Removed.
+        * fast/shadow-dom/css-scoping-shadow-assigned-node-with-before-after.html: Removed.
+        * fast/shadow-dom/css-scoping-shadow-assigned-node-with-rules-expected.html: Removed.
+        * fast/shadow-dom/css-scoping-shadow-assigned-node-with-rules.html: Removed.
+        * fast/shadow-dom/css-scoping-shadow-host-functional-rule-expected.html: Removed.
+        * fast/shadow-dom/css-scoping-shadow-host-functional-rule.html: Removed.
+        * fast/shadow-dom/css-scoping-shadow-host-rule-expected.html: Removed.
+        * fast/shadow-dom/css-scoping-shadow-host-rule.html: Removed.
+        * fast/shadow-dom/css-scoping-shadow-host-with-before-after-expected.html: Removed.
+        * fast/shadow-dom/css-scoping-shadow-host-with-before-after.html: Removed.
+        * fast/shadow-dom/css-scoping-shadow-invisible-slot-expected.html: Removed.
+        * fast/shadow-dom/css-scoping-shadow-invisible-slot.html: Removed.
+        * fast/shadow-dom/css-scoping-shadow-root-hides-children-expected.html: Removed.
+        * fast/shadow-dom/css-scoping-shadow-root-hides-children.html: Removed.
+        * fast/shadow-dom/css-scoping-shadow-slot-display-override-expected.html: Removed.
+        * fast/shadow-dom/css-scoping-shadow-slot-display-override.html: Removed.
+        * fast/shadow-dom/css-scoping-shadow-slot-expected.html: Removed.
+        * fast/shadow-dom/css-scoping-shadow-slot-fallback-expected.html: Removed.
+        * fast/shadow-dom/css-scoping-shadow-slot-fallback.html: Removed.
+        * fast/shadow-dom/css-scoping-shadow-slot.html: Removed.
+        * fast/shadow-dom/css-scoping-shadow-slotted-nested-expected.html: Removed.
+        * fast/shadow-dom/css-scoping-shadow-slotted-nested.html: Removed.
+        * fast/shadow-dom/css-scoping-shadow-slotted-rule-expected.html: Removed.
+        * fast/shadow-dom/css-scoping-shadow-slotted-rule.html: Removed.
+        * fast/shadow-dom/css-scoping-shadow-with-outside-rules-expected.html: Removed.
+        * fast/shadow-dom/css-scoping-shadow-with-outside-rules.html: Removed.
+        * fast/shadow-dom/css-scoping-shadow-with-rules-expected.html: Removed.
+        * fast/shadow-dom/css-scoping-shadow-with-rules-no-style-leak-expected.html: Removed.
+        * fast/shadow-dom/css-scoping-shadow-with-rules-no-style-leak.html: Removed.
+        * fast/shadow-dom/css-scoping-shadow-with-rules.html: Removed.
+
 2016-04-29  Yoav Weiss  <yoav@yoav.ws>
 
         Move ResourceTiming behind a runtime flag
diff --git a/LayoutTests/fast/shadow-dom/css-scoping-shadow-host-functional-rule.html b/LayoutTests/fast/shadow-dom/css-scoping-shadow-host-functional-rule.html
deleted file mode 100644 (file)
index f2713cf..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <title>CSS Scoping - :host() rules must apply to the shadow host.</title>
-    <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/>
-    <link rel="help" href="http://www.w3.org/TR/css-scoping-1/#selectors-data-model">
-    <link rel="match" href="reference/green-box.html"/>
-</head>
-<body>
-    <style>
-        host1, host2, host3, host4, host5 {
-            display: block;
-            width: 100px;
-            height: 20px;
-            background: red;
-        }
-        host3, host4, host5  {
-            background: green;
-        }
-    </style>
-    <p>Test passes if you see a single 100px by 100px green box below.</p>
-    <host1>
-        <div>FAIL</div>
-    </host1>
-    <host2 id="bar" class="foo" name="baz">
-        <div>FAIL</div>
-    </host2>
-    <div>
-        <host3>
-            FAIL
-        </host3>
-    </div>
-    <host4>
-        <div class="child">FAIL</div>
-    </host4>
-    <host5>
-        <div>FAIL</div>
-    </host5>
-    <script>
-
-        try {
-            var shadowHost = document.querySelector('host1');
-            shadowRoot = shadowHost.attachShadow({mode: 'open'});
-            shadowRoot.innerHTML = '<style> :host(host1) { background: green !important; } </style>';
-
-            shadowHost = document.querySelector('host2');
-            shadowRoot = shadowHost.attachShadow({mode: 'open'});
-            shadowRoot.innerHTML = '<style> :host(host2.foo#bar[name=baz]) { background: green !important; } </style>';
-
-            shadowHost = document.querySelector('host3');
-            shadowRoot = shadowHost.attachShadow({mode: 'open'});
-            shadowRoot.innerHTML = '<style> :host(div host3) { background: red !important; } </style>';
-
-            shadowHost = document.querySelector('host4');
-            shadowRoot = shadowHost.attachShadow({mode: 'open'});
-            shadowRoot.innerHTML = '<style> :host(.child) { background: red !important; } </style>';
-
-            shadowHost = document.querySelector('host5');
-            shadowRoot = shadowHost.attachShadow({mode: 'open'});
-            shadowRoot.innerHTML = '<style> :host(host1) { background: red !important; } </style>';
-        } catch (exception) {
-            document.body.appendChild(document.createTextNode(exception));
-        }
-
-    </script>
-</body>
-</html>
index 67ac66d..0c4b15c 100644 (file)
@@ -1,3 +1,50 @@
+2016-04-29  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Import W3C CSS WG tests for shadow DOM
+        https://bugs.webkit.org/show_bug.cgi?id=157063
+
+        Reviewed by Antti Koivisto.
+
+        Imported CSS WG's Scoping Level 1 tests from https://github.com/w3c/csswg-test
+        as of b2daa426addd5ccb8e9ce1c5d800f9d82603f1ec. Most of these tests are actually ours
+        except shadow-cascade-order-001.html.
+
+        * csswg-test: Added.
+        * csswg-test/css-scoping-1: Added.
+        * csswg-test/css-scoping-1/css-scoping-shadow-assigned-node-with-before-after-expected.html: Added.
+        * csswg-test/css-scoping-1/css-scoping-shadow-assigned-node-with-before-after.html: Added.
+        * csswg-test/css-scoping-1/css-scoping-shadow-assigned-node-with-rules-expected.html: Added.
+        * csswg-test/css-scoping-1/css-scoping-shadow-assigned-node-with-rules.html: Added.
+        * csswg-test/css-scoping-1/css-scoping-shadow-host-functional-rule-expected.html: Added.
+        * csswg-test/css-scoping-1/css-scoping-shadow-host-functional-rule.html: Added.
+        * csswg-test/css-scoping-1/css-scoping-shadow-host-rule-expected.html: Added.
+        * csswg-test/css-scoping-1/css-scoping-shadow-host-rule.html: Added.
+        * csswg-test/css-scoping-1/css-scoping-shadow-host-with-before-after-expected.html: Added.
+        * csswg-test/css-scoping-1/css-scoping-shadow-host-with-before-after.html: Added.
+        * csswg-test/css-scoping-1/css-scoping-shadow-invisible-slot-expected.html: Added.
+        * csswg-test/css-scoping-1/css-scoping-shadow-invisible-slot.html: Added.
+        * csswg-test/css-scoping-1/css-scoping-shadow-root-hides-children-expected.html: Added.
+        * csswg-test/css-scoping-1/css-scoping-shadow-root-hides-children.html: Added.
+        * csswg-test/css-scoping-1/css-scoping-shadow-slot-display-override-expected.html: Added.
+        * csswg-test/css-scoping-1/css-scoping-shadow-slot-display-override.html: Added.
+        * csswg-test/css-scoping-1/css-scoping-shadow-slot-expected.html: Added.
+        * csswg-test/css-scoping-1/css-scoping-shadow-slot-fallback-expected.html: Added.
+        * csswg-test/css-scoping-1/css-scoping-shadow-slot-fallback.html: Added.
+        * csswg-test/css-scoping-1/css-scoping-shadow-slot.html: Added.
+        * csswg-test/css-scoping-1/css-scoping-shadow-slotted-nested-expected.html: Added.
+        * csswg-test/css-scoping-1/css-scoping-shadow-slotted-nested.html: Added.
+        * csswg-test/css-scoping-1/css-scoping-shadow-slotted-rule-expected.html: Added.
+        * csswg-test/css-scoping-1/css-scoping-shadow-slotted-rule.html: Added.
+        * csswg-test/css-scoping-1/css-scoping-shadow-with-outside-rules-expected.html: Added.
+        * csswg-test/css-scoping-1/css-scoping-shadow-with-outside-rules.html: Added.
+        * csswg-test/css-scoping-1/css-scoping-shadow-with-rules-expected.html: Added.
+        * csswg-test/css-scoping-1/css-scoping-shadow-with-rules-no-style-leak-expected.html: Added.
+        * csswg-test/css-scoping-1/css-scoping-shadow-with-rules-no-style-leak.html: Added.
+        * csswg-test/css-scoping-1/css-scoping-shadow-with-rules.html: Added.
+        * csswg-test/css-scoping-1/shadow-cascade-order-001-expected.txt: Added.
+        * csswg-test/css-scoping-1/shadow-cascade-order-001.html: Added.
+        * csswg-test/css-scoping-1/w3c-import.log: Added.
+
 2016-04-28  Youenn Fablet  <youenn.fablet@crf.canon.fr>
 
         [Fetch API] Import remaining fetch tests
@@ -1,5 +1,9 @@
 <!DOCTYPE html>
 <html>
+<head>
+    <title>CSS Scoping Module Level 1 - A green box reference</title>
+    <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/>
+</head>
 <body>
     <p>Test passes if you see a single 100px by 100px green box below.</p>
     <div style="width: 100px; height: 100px; background: green;"></div>
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
 <head>
-    <title>CSS Scoping - before and after contents on a node assigned to a slot element must be rendered</title>
+    <title>CSS Scoping Module Level 1 - ::before and ::after pseudo class' contents on a node assigned to a slot element must be rendered</title>
     <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/>
     <link rel="help" href="http://www.w3.org/TR/css-scoping-1/#selectors-data-model">
     <link rel="match" href="reference/green-box.html"/>
             width: 100%;
             height: 50px;
         }
-        [slot=foo]:before,
-        [slot=foo]:after {
+        [slot=foo]::before,
+        [slot=foo]::after {
             display: block;
             content: "";
             width: 100%;
             height: 25px;
         }
-        [slot=foo]:before,
-        [slot=foo]:after {
+        [slot=foo]::before,
+        [slot=foo]::after {
             background: green;
         }
-        [slot=bar]:before,
-        [slot=bar]:after {
+        [slot=bar]::before,
+        [slot=bar]::after {
             background: yellow;
         }
     </style>
@@ -1,5 +1,9 @@
 <!DOCTYPE html>
 <html>
+<head>
+    <title>CSS Scoping Module Level 1 - A green box reference</title>
+    <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/>
+</head>
 <body>
     <p>Test passes if you see a single 100px by 100px green box below.</p>
     <div style="width: 100px; height: 100px; background: green;"></div>
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
 <head>
-    <title>CSS Scoping - only rules outside a shadow tree must apply to nodes assigned to a slot in the shadow tree.</title>
+    <title>CSS Scoping Module Level 1 - Only rules outside a shadow tree must apply to nodes assigned to a slot in the shadow tree.</title>
     <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/>
     <link rel="help" href="http://www.w3.org/TR/css-scoping-1/#selectors-data-model">
     <link rel="match" href="reference/green-box.html"/>
@@ -1,5 +1,9 @@
 <!DOCTYPE html>
 <html>
+<head>
+    <title>CSS Scoping Module Level 1 - A green box reference</title>
+    <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/>
+</head>
 <body>
     <p>Test passes if you see a single 100px by 100px green box below.</p>
     <div style="width: 100px; height: 100px; background: green;"></div>
diff --git a/LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-host-functional-rule.html b/LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-host-functional-rule.html
new file mode 100644 (file)
index 0000000..13f9a67
--- /dev/null
@@ -0,0 +1,67 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>CSS Scoping Module Level 1 - :host() rules must apply to the shadow host.</title>
+    <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/>
+    <link rel="help" href="http://www.w3.org/TR/css-scoping-1/#host-selector">
+    <link rel="match" href="reference/green-box.html"/>
+</head>
+<body>
+    <style>
+        host-1, host-2, host-3, host-4, host-5 {
+            display: block;
+            width: 100px;
+            height: 20px;
+            background: red;
+        }
+        host-3, host-4, host-5  {
+            background: green;
+        }
+    </style>
+    <p>Test passes if you see a single 100px by 100px green box below.</p>
+    <host-1>
+        <div>FAIL1</div>
+    </host-1>
+    <host-2 id="bar" class="foo" name="baz">
+        <div>FAIL2</div>
+    </host-2>
+    <div>
+        <host-3>
+            FAIL3
+        </host-3>
+    </div>
+    <host-4>
+        <div class="child">FAIL4</div>
+    </host-4>
+    <host-5>
+        <div>FAIL5</div>
+    </host-5>
+    <script>
+
+        try {
+            var shadowHost = document.querySelector('host-1');
+            shadowRoot = shadowHost.attachShadow({mode: 'open'});
+            shadowRoot.innerHTML = '<style> :host(host-1) { background: green !important; } </style>';
+
+            shadowHost = document.querySelector('host-2');
+            shadowRoot = shadowHost.attachShadow({mode: 'open'});
+            shadowRoot.innerHTML = '<style> :host(host-2.foo#bar[name=baz]) { background: green !important; } </style>';
+
+            shadowHost = document.querySelector('host-3');
+            shadowRoot = shadowHost.attachShadow({mode: 'open'});
+            shadowRoot.innerHTML = '<style> :host(div host-3) { background: red !important; } </style>';
+
+            shadowHost = document.querySelector('host-4');
+            shadowRoot = shadowHost.attachShadow({mode: 'open'});
+            shadowRoot.innerHTML = '<style> :host(.child) { background: red !important; } </style>';
+
+            shadowHost = document.querySelector('host-5');
+            shadowRoot = shadowHost.attachShadow({mode: 'open'});
+            shadowRoot.innerHTML = '<style> :host(host-1) { background: red !important; } </style>';
+        } catch (exception) {
+            document.body.appendChild(document.createTextNode(exception));
+        }
+
+    </script>
+</body>
+</html>
@@ -1,5 +1,9 @@
 <!DOCTYPE html>
 <html>
+<head>
+    <title>CSS Scoping Module Level 1 - A green box reference</title>
+    <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/>
+</head>
 <body>
     <p>Test passes if you see a single 100px by 100px green box below.</p>
     <div style="width: 100px; height: 100px; background: green;"></div>
@@ -1,9 +1,9 @@
 <!DOCTYPE html>
 <html>
 <head>
-    <title>CSS Scoping - :host rules must apply to the shadow host.</title>
+    <title>CSS Scoping Module Level 1 - :host rules must apply to the shadow host.</title>
     <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/>
-    <link rel="help" href="http://www.w3.org/TR/css-scoping-1/#selectors-data-model">
+    <link rel="help" href="http://www.w3.org/TR/css-scoping-1/#host-selector">
     <link rel="match" href="reference/green-box.html"/>
 </head>
 <body>
@@ -1,5 +1,9 @@
 <!DOCTYPE html>
 <html>
+<head>
+    <title>CSS Scoping Module Level 1 - A green box reference</title>
+    <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/>
+</head>
 <body>
     <p>Test passes if you see a single 100px by 100px green box below.</p>
     <div style="width: 100px; height: 100px; background: green;"></div>
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
 <head>
-    <title>CSS Scoping - before and after contents on a shadow host must be rendered</title>
+    <title>CSS Scoping Module Level 1 - ::before and ::after pseudo elements' contents on a shadow host must be rendered</title>
     <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/>
     <link rel="help" href="http://www.w3.org/TR/css-scoping-1/#selectors-data-model">
     <link rel="match" href="reference/green-box.html"/>
             height: 100px;
             background: red;
         }
-        my-host:before {
+        my-host::before {
             display: block;
             content: "";
             width: 100px;
             height: 25px;
             background: green;
         }
-        my-host:after {
+        my-host::after {
             display: block;
             content: "";
             width: 100px;
@@ -1,5 +1,9 @@
 <!DOCTYPE html>
 <html>
+<head>
+    <title>CSS Scoping Module Level 1 - A green box reference</title>
+    <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/>
+</head>
 <body>
     <p>Test passes if you see a single 100px by 100px green box below.</p>
     <div style="width: 100px; height: 100px; background: green;"></div>
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
 <head>
-    <title>CSS Scoping - elements with a distribution list should generate boxes in the formatting tree.</title>
+    <title>CSS Scoping Module Level 1 - elements with a distribution list should generate boxes in the formatting tree.</title>
     <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/>
     <link rel="help" href="http://www.w3.org/TR/css-scoping-1/#selectors-data-model">
     <link rel="match" href="reference/green-box.html"/>
@@ -1,5 +1,9 @@
 <!DOCTYPE html>
 <html>
+<head>
+    <title>CSS Scoping Module Level 1 - A green box reference</title>
+    <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/>
+</head>
 <body>
     <p>Test passes if you see a single 100px by 100px green box below.</p>
     <div style="width: 100px; height: 100px; background: green;"></div>
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
 <head>
-    <title>CSS Scoping - a shadow tree hides non-distributed children of the host</title>
+    <title>CSS Scoping Module Level 1 - a shadow tree hides non-distributed children of the host</title>
     <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/>
     <link rel="help" href="http://www.w3.org/TR/css-scoping-1/#selectors-data-model">
     <link rel="match" href="reference/green-box.html"/>
@@ -1,5 +1,9 @@
 <!DOCTYPE html>
 <html>
+<head>
+    <title>CSS Scoping Module Level 1 - A green box reference</title>
+    <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/>
+</head>
 <body>
     <p>Test passes if you see a single 100px by 100px green box below.</p>
     <div style="width: 100px; height: 100px; background: green;"></div>
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
 <head>
-    <title>CSS Scoping - overriding slot element's display value should generate boxes</title>
+    <title>CSS Scoping Module Level 1 - overriding slot element's display value should generate boxes</title>
     <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/>
     <link rel="help" href="http://www.w3.org/TR/css-scoping-1/#selectors-data-model">
     <link rel="match" href="reference/green-box.html"/>
@@ -1,5 +1,9 @@
 <!DOCTYPE html>
 <html>
+<head>
+    <title>CSS Scoping Module Level 1 - A green box reference</title>
+    <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/>
+</head>
 <body>
     <p>Test passes if you see a single 100px by 100px green box below.</p>
     <div style="width: 100px; height: 100px; background: green;"></div>
@@ -1,5 +1,9 @@
 <!DOCTYPE html>
 <html>
+<head>
+    <title>CSS Scoping Module Level 1 - A green box reference</title>
+    <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/>
+</head>
 <body>
     <p>Test passes if you see a single 100px by 100px green box below.</p>
     <div style="width: 100px; height: 100px; background: green;"></div>
@@ -1,8 +1,9 @@
 <!DOCTYPE html>
 <html>
 <head>
-    <title>CSS Scoping - slot element without distributed nodes must render its fallback content</title>
+    <title>CSS Scoping Module Level 1 - slot element without distributed nodes must render its fallback content</title>
     <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/>
+    <link rel="help" href="http://www.w3.org/TR/css-scoping-1/#selectors-data-model">
     <link rel="match" href="reference/green-box.html"/>
 </head>
 <body>
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
 <head>
-    <title>CSS Scoping - elements with a distribution list should generate boxes in the formatting tree.</title>
+    <title>CSS Scoping Module Level 1 - elements with a distribution list should generate boxes in the formatting tree.</title>
     <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/>
     <link rel="help" href="http://www.w3.org/TR/css-scoping-1/#selectors-data-model">
     <link rel="match" href="reference/green-box.html"/>
@@ -1,5 +1,9 @@
 <!DOCTYPE html>
 <html>
+<head>
+    <title>CSS Scoping Module Level 1 - A green box reference</title>
+    <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/>
+</head>
 <body>
     <p>Test passes if you see a single 100px by 100px green box below.</p>
     <div style="width: 100px; height: 100px; background: green;"></div>
@@ -1,9 +1,9 @@
 <!DOCTYPE html>
 <html>
 <head>
-    <title>CSS Scoping - ::slotted pseudo element rule must apply to an element that got slotted via another slot</title>
+    <title>CSS Scoping Module Level 1 - ::slotted pseudo element rule must apply to an element that got slotted via another slot</title>
     <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/>
-    <link rel="help" href="http://www.w3.org/TR/css-scoping-1/#selectors-data-model">
+    <link rel="help" href="http://www.w3.org/TR/css-scoping-1/#slotted-pseudo">
     <link rel="match" href="reference/green-box.html"/>
 </head>
 <body>
@@ -1,5 +1,9 @@
 <!DOCTYPE html>
 <html>
+<head>
+    <title>CSS Scoping Module Level 1 - A green box reference</title>
+    <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/>
+</head>
 <body>
     <p>Test passes if you see a single 100px by 100px green box below.</p>
     <div style="width: 100px; height: 100px; background: green;"></div>
@@ -1,9 +1,9 @@
 <!DOCTYPE html>
 <html>
 <head>
-    <title>CSS Scoping - :slotted pseudo element must allow selecting elements assigned to a slot element</title>
+    <title>CSS Scoping Module Level 1 - :slotted pseudo element must allow selecting elements assigned to a slot element</title>
     <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/>
-    <link rel="help" href="http://www.w3.org/TR/css-scoping-1/#selectors-data-model">
+    <link rel="help" href="http://www.w3.org/TR/css-scoping-1/#slotted-pseudo">
     <link rel="match" href="reference/green-box.html"/>
 </head>
 <body>
@@ -1,5 +1,9 @@
 <!DOCTYPE html>
 <html>
+<head>
+    <title>CSS Scoping Module Level 1 - A green box reference</title>
+    <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/>
+</head>
 <body>
     <p>Test passes if you see a single 100px by 100px green box below.</p>
     <div style="width: 100px; height: 100px; background: green;"></div>
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
 <head>
-    <title>CSS Scoping - a selector outside a shadow tree should not match nodes inside the shadow tree</title>
+    <title>CSS Scoping Module Level 1 - a selector outside a shadow tree should not match nodes inside the shadow tree</title>
     <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/>
     <link rel="help" href="http://www.w3.org/TR/css-scoping-1/#selectors-data-model">
     <link rel="match" href="reference/green-box.html"/>
@@ -1,5 +1,9 @@
 <!DOCTYPE html>
 <html>
+<head>
+    <title>CSS Scoping Module Level 1 - A green box reference</title>
+    <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/>
+</head>
 <body>
     <p>Test passes if you see a single 100px by 100px green box below.</p>
     <div style="width: 100px; height: 100px; background: green;"></div>
@@ -1,5 +1,9 @@
 <!DOCTYPE html>
 <html>
+<head>
+    <title>CSS Scoping Module Level 1 - A green box reference</title>
+    <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/>
+</head>
 <body>
     <p>Test passes if you see a single 100px by 100px green box below.</p>
     <div style="width: 100px; height: 100px; background: green;"></div>
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
 <head>
-    <title>CSS Scoping - a style rule inside a shadow tree doesn't affect the normal dom</title>
+    <title>CSS Scoping Module Level 1 - a style rule inside a shadow tree doesn't affect the normal dom</title>
     <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/>
     <link rel="help" href="http://www.w3.org/TR/css-scoping-1/#selectors-data-model">
     <link rel="match" href="reference/green-box.html"/>
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
 <head>
-    <title>CSS Scoping - a selector inside a shadow tree is matched against nodes in the shadow tree</title>
+    <title>CSS Scoping Module Level 1 - a selector inside a shadow tree is matched against nodes in the shadow tree</title>
     <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/>
     <link rel="help" href="http://www.w3.org/TR/css-scoping-1/#selectors-data-model">
     <link rel="match" href="reference/green-box.html"/>
diff --git a/LayoutTests/imported/w3c/csswg-test/css-scoping-1/shadow-cascade-order-001-expected.txt b/LayoutTests/imported/w3c/csswg-test/css-scoping-1/shadow-cascade-order-001-expected.txt
new file mode 100644 (file)
index 0000000..a7db1bb
--- /dev/null
@@ -0,0 +1,66 @@
+
+PASS A1. document vs ::slotted, document rule should win for open mode. 
+PASS A2. document vs :host, document rule should win for open mode. 
+PASS A3. document vs inline, inline rule should win for open mode. 
+PASS A4. ::slotted vs :host, earlier in tree-of-trees rule should win for open mode. 
+PASS A5. ::slotted vs inline, inline rule should win for open mode. 
+PASS A6. :host vs inline, inline rule should win for open mode. 
+PASS B1. document with !important vs ::slotted, document rule should win for open mode. 
+PASS B2. document with !important vs :host, document rule should win for open mode. 
+PASS B3. document vs inline with !important, inline rule should win for open mode. 
+PASS B4. ::slotted  with !important vs :host, earlier in tree-of-trees rule should win for open mode. 
+PASS B5. ::slotted vs inline with !important, inline rule should win for open mode. 
+PASS B6. :host vs inline with !important, inline rule should win for open mode. 
+PASS C1. document vs ::slotted with !important, ::slotted rule should win for open mode. 
+PASS C2. document vs :host with !important, :host rule should win for open mode. 
+PASS C3. document with !important vs inline, document rule should win for open mode. 
+PASS C4. ::slotted vs :host with !important, later in tree-of-trees rule should win for open mode. 
+PASS C5. ::slotted with !important vs inline, ::slotted rule should win for open mode. 
+PASS C6. :host with !important vs inline, :host rule should win for open mode. 
+FAIL D1. document vs ::slotted both with !important, ::slotted rule should win for open mode. assert_equals: D1. document vs ::slotted both with !important, ::slotted rule should win expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
+FAIL D2. document vs :host both with !important, :host rule should win for open mode. assert_equals: D2. document vs :host both with !important, :host rule should win expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
+PASS D3. document vs inline both with !important, inline rule should win for open mode. 
+FAIL D4. ::slotted vs :host both with !important, later in tree-of-trees rule should win for open mode. assert_equals: D4. ::slotted vs :host both with !important, later in tree-of-trees rule should win expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
+FAIL D5. ::slotted vs inline both with !important, ::slotted rule should win for open mode. assert_equals: D5. ::slotted vs inline both with !important, ::slotted rule should win expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
+FAIL D6. :host vs inline both with !important, :host rule should win for open mode. assert_equals: D6. :host vs inline both with !important, :host rule should win expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
+PASS E1. all style applied, inline rule should win for open mode. 
+FAIL E2. all styles with !important applied, rule in the last tree-of-trees should win for open mode. assert_equals: E2. all styles with !important applied, rule in the last tree-of-trees should win expected "rgb(0, 128, 0)" but got "rgb(255, 255, 0)"
+PASS A1. document vs ::slotted, document rule should win for closed mode. 
+PASS A2. document vs :host, document rule should win for closed mode. 
+PASS A3. document vs inline, inline rule should win for closed mode. 
+PASS A4. ::slotted vs :host, earlier in tree-of-trees rule should win for closed mode. 
+PASS A5. ::slotted vs inline, inline rule should win for closed mode. 
+PASS A6. :host vs inline, inline rule should win for closed mode. 
+PASS B1. document with !important vs ::slotted, document rule should win for closed mode. 
+PASS B2. document with !important vs :host, document rule should win for closed mode. 
+PASS B3. document vs inline with !important, inline rule should win for closed mode. 
+PASS B4. ::slotted  with !important vs :host, earlier in tree-of-trees rule should win for closed mode. 
+PASS B5. ::slotted vs inline with !important, inline rule should win for closed mode. 
+PASS B6. :host vs inline with !important, inline rule should win for closed mode. 
+PASS C1. document vs ::slotted with !important, ::slotted rule should win for closed mode. 
+PASS C2. document vs :host with !important, :host rule should win for closed mode. 
+PASS C3. document with !important vs inline, document rule should win for closed mode. 
+PASS C4. ::slotted vs :host with !important, later in tree-of-trees rule should win for closed mode. 
+PASS C5. ::slotted with !important vs inline, ::slotted rule should win for closed mode. 
+PASS C6. :host with !important vs inline, :host rule should win for closed mode. 
+FAIL D1. document vs ::slotted both with !important, ::slotted rule should win for closed mode. assert_equals: D1. document vs ::slotted both with !important, ::slotted rule should win expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
+FAIL D2. document vs :host both with !important, :host rule should win for closed mode. assert_equals: D2. document vs :host both with !important, :host rule should win expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
+PASS D3. document vs inline both with !important, inline rule should win for closed mode. 
+FAIL D4. ::slotted vs :host both with !important, later in tree-of-trees rule should win for closed mode. assert_equals: D4. ::slotted vs :host both with !important, later in tree-of-trees rule should win expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
+FAIL D5. ::slotted vs inline both with !important, ::slotted rule should win for closed mode. assert_equals: D5. ::slotted vs inline both with !important, ::slotted rule should win expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
+FAIL D6. :host vs inline both with !important, :host rule should win for closed mode. assert_equals: D6. :host vs inline both with !important, :host rule should win expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
+PASS E1. all style applied, inline rule should win for closed mode. 
+FAIL E2. all styles with !important applied, rule in the last tree-of-trees should win for closed mode. assert_equals: E2. all styles with !important applied, rule in the last tree-of-trees should win expected "rgb(0, 128, 0)" but got "rgb(255, 255, 0)"
+PASS F1. document vs others, document (the first rule in tree-of-trees order) rule should win for open mode. 
+PASS F2. document with !important vs others, document rule should win for open mode. 
+PASS F3. document vs ::slotted with !important, important rule should win for open mode. 
+PASS F4. document vs ::slotted with !important, important rule should win for open mode. 
+PASS F5. document vs :host with !important, important rule should win for open mode. 
+FAIL F6. all rules with !important, the last rule in tree-of-trees should win for open mode. assert_equals: F6. all rules with !important, the last rule in tree-of-trees should win expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
+PASS F1. document vs others, document (the first rule in tree-of-trees order) rule should win for closed mode. 
+PASS F2. document with !important vs others, document rule should win for closed mode. 
+PASS F3. document vs ::slotted with !important, important rule should win for closed mode. 
+PASS F4. document vs ::slotted with !important, important rule should win for closed mode. 
+PASS F5. document vs :host with !important, important rule should win for closed mode. 
+FAIL F6. all rules with !important, the last rule in tree-of-trees should win for closed mode. assert_equals: F6. all rules with !important, the last rule in tree-of-trees should win expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
+
diff --git a/LayoutTests/imported/w3c/csswg-test/css-scoping-1/shadow-cascade-order-001.html b/LayoutTests/imported/w3c/csswg-test/css-scoping-1/shadow-cascade-order-001.html
new file mode 100644 (file)
index 0000000..72bc455
--- /dev/null
@@ -0,0 +1,403 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Shadow DOM: CSS Style Rule cascading</title>
+<meta name="assert" content="Cascading order test for style rules from various shadow trees.">
+<link rel="author" title="Takayoshi Kochi" href="mailto:kochi@google.com">
+<link rel="help" href="https://drafts.csswg.org/css-scoping-1/#shadow-cascading">
+<script src="../../../../resources/testharness.js"></script>
+<script src="../../../../resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script>
+
+// Taken from the example in
+// https://github.com/w3c/webcomponents/blob/gh-pages/proposals/Shadow-DOM-Cascade-Order.md
+// https://github.com/w3c/webcomponents/issues/316
+// https://github.com/w3c/webcomponents/blob/gh-pages/proposals/Shadow-DOM-Cascade-Order-in-v1.md
+// with element renamed and style rule location changed.
+//
+// <style>my-item { color: red; }</style>
+// <my-list>
+//   <:shadow>
+//     <style>::slotted(my-item) { color: blue; }</style>
+//     <slot/>
+//   </:shadow>
+//   <my-item style="color: green;">
+//     <:shadow>
+//       <style>:host { color: yellow; }</style>
+//       <slot/>
+//     </:shadow>
+//     ITEM
+//   </my-item>
+// </my-list>
+//
+// There are 4 possible style rules that applies to <my-item> above:
+// 1. document-wide style
+// 2. ::slotted style in the shadow in <my-list>
+// 3. :host style in the shadow in <my-item>
+// 4. inline style within <my-item> itself.
+//
+// It could be possible to nest many more shadow trees in <my-list>,
+// but to prevent the number of combination explosion, such case is covered
+// in another test file.
+//
+// So testing cases where 2 style rules are competing,
+// 4C2 = 6 combinations exist, multiplied by 4, which is the possible
+// combination of applying "!important" for the 2 style rules.
+
+function createMyList(mode, slottedStyle, hostStyle, inlineStyle) {
+    var myList = document.createElement('my-list');
+    var root = myList.attachShadow({'mode': mode});
+    root.innerHTML = '<style>' + slottedStyle + '</style><slot></slot>';
+    var myItem = document.createElement('my-item');
+    if (inlineStyle !== '')
+        myItem.setAttribute('style', inlineStyle);
+    myList.appendChild(myItem);
+    var root2 = myItem.attachShadow({'mode': mode});
+    root2.innerHTML = '<style>' + hostStyle + '</style><slot></slot>';
+    myItem.appendChild(document.createTextNode('ITEM'));
+    return myList;
+}
+
+function testCascadingOrder(mode) {
+    // In all test cases, the rule specified as "color: green" should win.
+    var testCases = [
+        // [A] Cases between document, ::slotteed, :host, and inline
+        {
+            title: 'A1. document vs ::slotted, document rule should win',
+            documentStyle: 'my-item { color: green; }',
+            slottedStyle: '::slotted(my-item) { color: red; }',
+            hostStyle: '',
+            inlineStyle: ''
+        },
+        {
+            title: 'A2. document vs :host, document rule should win',
+            documentStyle: 'my-item { color: green; }',
+            slottedStyle: '',
+            hostStyle: ':host { color: red; }',
+            inlineStyle: ''
+        },
+        {
+            title: 'A3. document vs inline, inline rule should win',
+            documentStyle: 'my-item { color: red; }',
+            slottedStyle: '',
+            hostStyle: '',
+            inlineStyle: 'color: green;'
+        },
+        {
+            title: 'A4. ::slotted vs :host, earlier in tree-of-trees rule should win',
+            documentStyle: '',
+            slottedStyle: '::slotted(my-item) { color: green; }',
+            hostStyle: ':host { color: red; }',
+            inlineStyle: ''
+        },
+        {
+            title: 'A5. ::slotted vs inline, inline rule should win',
+            documentStyle: '',
+            slottedStyle: '::slotted(my-item) { color: red; }',
+            hostStyle: '',
+            inlineStyle: 'color: green;'
+        },
+        {
+            title: 'A6. :host vs inline, inline rule should win',
+            documentStyle: '',
+            slottedStyle: '',
+            hostStyle: ':host { color: red; }',
+            inlineStyle: 'color: green;'
+        },
+
+        // [B] Stronger rule is still stronger with !important
+        {
+            title: 'B1. document with !important vs ::slotted, document rule should win',
+            documentStyle: 'my-item { color: green !important; }',
+            slottedStyle: '::slotted(my-item) { color: red; }',
+            hostStyle: '',
+            inlineStyle: ''
+        },
+        {
+            title: 'B2. document with !important vs :host, document rule should win',
+            documentStyle: 'my-item { color: green !important; }',
+            slottedStyle: '',
+            hostStyle: ':host { color: red; }',
+            inlineStyle: ''
+        },
+        {
+            title: 'B3. document vs inline with !important, inline rule should win',
+            documentStyle: 'my-item { color: red; }',
+            slottedStyle: '',
+            hostStyle: '',
+            inlineStyle: 'color: green !important;'
+        },
+        {
+            title: 'B4. ::slotted  with !important vs :host, earlier in tree-of-trees rule should win',
+            documentStyle: '',
+            slottedStyle: '::slotted(my-item) { color: green !important; }',
+            hostStyle: ':host { color: red; }',
+            inlineStyle: ''
+        },
+        {
+            title: 'B5. ::slotted vs inline with !important, inline rule should win',
+            documentStyle: '',
+            slottedStyle: '::slotted(my-item) { color: green !important; }',
+            hostStyle: '',
+            inlineStyle: 'color: red;'
+        },
+        {
+            title: 'B6. :host vs inline with !important, inline rule should win',
+            documentStyle: '',
+            slottedStyle: '',
+            hostStyle: ':host { color: red; }',
+            inlineStyle: 'color: green !important;'
+        },
+
+        // [C] Weaker rule gets stronger with !important
+        {
+            title: 'C1. document vs ::slotted with !important, ::slotted rule should win',
+            documentStyle: 'my-item { color: red; }',
+            slottedStyle: '::slotted(my-item) { color: green !important; }',
+            hostStyle: '',
+            inlineStyle: ''
+        },
+        {
+            title: 'C2. document vs :host with !important, :host rule should win',
+            documentStyle: 'my-item { color: red; }',
+            slottedStyle: '',
+            hostStyle: ':host { color: green !important; }',
+            inlineStyle: ''
+        },
+        {
+            title: 'C3. document with !important vs inline, document rule should win',
+            documentStyle: 'my-item { color: green !important; }',
+            slottedStyle: '',
+            hostStyle: '',
+            inlineStyle: 'color: red;'
+        },
+        {
+            title: 'C4. ::slotted vs :host with !important, later in tree-of-trees rule should win',
+            documentStyle: '',
+            slottedStyle: '::slotted(my-item) { color: green !important; }',
+            hostStyle: ':host { color: red; }',
+            inlineStyle: ''
+        },
+        {
+            title: 'C5. ::slotted with !important vs inline, ::slotted rule should win',
+            documentStyle: '',
+            slottedStyle: '::slotted(my-item) { color: green !important; }',
+            hostStyle: '',
+            inlineStyle: 'color: red;'
+        },
+        {
+            title: 'C6. :host with !important vs inline, :host rule should win',
+            documentStyle: '',
+            slottedStyle: '',
+            hostStyle: ':host { color: green !important; }',
+            inlineStyle: 'color: red;'
+        },
+
+        // [D] Cases between document, ::slotteed, :host, and inline, both with !important
+        {
+            title: 'D1. document vs ::slotted both with !important, ::slotted rule should win',
+            documentStyle: 'my-item { color: red !important; }',
+            slottedStyle: '::slotted(my-item) { color: green !important; }',
+            hostStyle: '',
+            inlineStyle: ''
+        },
+        {
+            title: 'D2. document vs :host both with !important, :host rule should win',
+            documentStyle: 'my-item { color: red !important; }',
+            slottedStyle: '',
+            hostStyle: ':host { color: green !important; }',
+            inlineStyle: ''
+        },
+        {
+            title: 'D3. document vs inline both with !important, inline rule should win',
+            documentStyle: 'my-item { color: red !important; }',
+            slottedStyle: '',
+            hostStyle: '',
+            inlineStyle: 'color: green !important;'
+        },
+        {
+            title: 'D4. ::slotted vs :host both with !important, later in tree-of-trees rule should win',
+            documentStyle: '',
+            slottedStyle: '::slotted(my-item) { color: red !important; }',
+            hostStyle: ':host { color: green !important; }',
+            inlineStyle: ''
+        },
+        {
+            title: 'D5. ::slotted vs inline both with !important, ::slotted rule should win',
+            documentStyle: '',
+            slottedStyle: '::slotted(my-item) { color: green !important; }',
+            hostStyle: '',
+            inlineStyle: 'color: red !important;'
+        },
+        {
+            title: 'D6. :host vs inline both with !important, :host rule should win',
+            documentStyle: '',
+            slottedStyle: '',
+            hostStyle: ':host { color: green !important; }',
+            inlineStyle: 'color: red !important;'
+        },
+        // [E] Putting all together
+        {
+            title: 'E1. all style applied, inline rule should win',
+            documentStyle: 'my-item { color: red; }',
+            slottedStyle: '::slotted(my-item) { color: blue; }',
+            hostStyle: ':host { color: yellow; }',
+            inlineStyle: 'color: green;'
+        },
+        {
+            title: 'E2. all styles with !important applied, rule in the last tree-of-trees should win',
+            documentStyle: 'my-item { color: red !important; }',
+            slottedStyle: '::slotted(my-item) { color: blue !important; }',
+            hostStyle: ':host { color: green !important; }',
+            inlineStyle: 'color: yellow !important;'
+        },
+    ];
+
+    for (var i = 0; i < testCases.length; ++i) {
+        var testCase = testCases[i];
+        var documentStyle = document.createElement('style');
+        documentStyle.appendChild(document.createTextNode(testCase['documentStyle']));
+        document.head.appendChild(documentStyle);
+
+        var myList = createMyList(mode,
+            testCase['slottedStyle'], testCase['hostStyle'], testCase['inlineStyle']);
+        document.body.appendChild(myList);
+
+        test(function () {
+            var myItem = myList.querySelector('my-item');
+            assert_equals(window.getComputedStyle(myItem).color, 'rgb(0, 128, 0)',
+                          testCase['title']);
+        }, testCase['title'] + ' for ' + mode + ' mode.');
+
+        myList.parentNode.removeChild(myList);
+        document.head.removeChild(documentStyle)
+    }
+}
+
+// Open or Closed should not make any difference in style application.
+testCascadingOrder('open');
+testCascadingOrder('closed');
+
+
+// Taken from the example in
+// https://github.com/w3c/webcomponents/blob/gh-pages/proposals/Shadow-DOM-Cascade-Order.md
+// https://github.com/w3c/webcomponents/issues/316
+// https://github.com/w3c/webcomponents/blob/gh-pages/proposals/Shadow-DOM-Cascade-Order-in-v1.md
+// with element renamed and style rule location changed.
+//
+// <style>my-item { color: red; }</style>
+// <my-list>
+//   <:shadow>
+//     <style>::slotted(my-item) { color: blue; }</style>
+//     <div>
+//       <:shadow>
+//         <slot/>
+//       </:shadow>
+//       <slot/>
+//     </div>
+//   </:shadow>
+//   <my-item style="color: green;">
+//     <:shadow>
+//       <style>:host { color: yellow; }</style>
+//       <slot/>
+//     </:shadow>
+//     ITEM
+//   </my-item>
+// </my-list>
+//
+// The difference from the example tree above is that <my-list> has 2 levels of
+// shadow trees, each with ::slotted(my-list) style rules.
+
+function createMyListWith2LevelShadow(mode, slottedStyle1, slottedStyle2, hostStyle) {
+    var myList = document.createElement('my-list');
+    var root = myList.attachShadow({'mode': mode});
+    root.innerHTML = '<style>' + slottedStyle1 + '</style><div><slot></slot></div>';
+    var div = root.querySelector('div');
+    var root2 = div.attachShadow({'mode': mode});
+    root2.innerHTML = '<style>' + slottedStyle2 + '</style><slot></slot>';
+    var myItem = document.createElement('my-item');
+    myList.appendChild(myItem);
+    var root3 = myItem.attachShadow({'mode': mode});
+    root3.innerHTML = '<style>' + hostStyle + '</style><slot></slot>';
+    myItem.appendChild(document.createTextNode('ITEM'));
+    return myList;
+}
+
+function testCascadingOrderWith2LevelShadow(mode) {
+    // In all test cases, the rule specified as "color: green" should win.
+    var testCases = [
+        {
+            title: 'F1. document vs others, document (the first rule in tree-of-trees order) rule should win',
+            documentStyle: 'my-item { color: green; }',
+            slottedStyle1: '::slotted(my-item) { color: red; }',
+            slottedStyle2: '::slotted(my-item) { color: red; }',
+            hostStyle: ':host { color: red; }',
+        },
+        {
+            title: 'F2. document with !important vs others, document rule should win',
+            documentStyle: 'my-item { color: green !important; }',
+            slottedStyle1: '::slotted(my-item) { color: red; }',
+            slottedStyle2: '::slotted(my-item) { color: red; }',
+            hostStyle: ':host { color: red; }',
+        },
+        {
+            title: 'F3. document vs ::slotted with !important, important rule should win',
+            documentStyle: 'my-item { color: red; }',
+            slottedStyle1: '::slotted(my-item) { color: green !important; }',
+            slottedStyle2: '::slotted(my-item) { color: red; }',
+            hostStyle: ':host { color: red; }',
+        },
+        {
+            title: 'F4. document vs ::slotted with !important, important rule should win',
+            documentStyle: 'my-item { color: red; }',
+            slottedStyle1: '::slotted(my-item) { color: red; }',
+            slottedStyle2: '::slotted(my-item) { color: green !important; }',
+            hostStyle: ':host { color: red; }',
+        },
+        {
+            title: 'F5. document vs :host with !important, important rule should win',
+            documentStyle: 'my-item { color: red; }',
+            slottedStyle1: '::slotted(my-item) { color: red; }',
+            slottedStyle2: '::slotted(my-item) { color: red; }',
+            hostStyle: ':host { color: green !important; }',
+        },
+        {
+            title: 'F6. all rules with !important, the last rule in tree-of-trees should win',
+            documentStyle: 'my-item { color: red !important; }',
+            slottedStyle1: '::slotted(my-item) { color: red !important; }',
+            slottedStyle2: '::slotted(my-item) { color: red !important; }',
+            hostStyle: ':host { color: green !important ; }',
+        }
+    ];
+
+    for (var i = 0; i < testCases.length; ++i) {
+        var testCase = testCases[i];
+        var documentStyle = document.createElement('style');
+        documentStyle.appendChild(document.createTextNode(testCase['documentStyle']));
+        document.head.appendChild(documentStyle);
+
+        var myList = createMyListWith2LevelShadow(mode,
+            testCase['slottedStyle1'], testCase['slottedStyle2'], testCase['hostStyle']);
+        document.body.appendChild(myList);
+
+        test(function () {
+            var myItem = myList.querySelector('my-item');
+            assert_equals(window.getComputedStyle(myItem).color, 'rgb(0, 128, 0)',
+                          testCase['title']);
+        }, testCase['title'] + ' for ' + mode + ' mode.');
+
+        myList.parentNode.removeChild(myList);
+        document.head.removeChild(documentStyle)
+    }
+}
+
+// Open or Closed should not make any difference in style application.
+testCascadingOrderWith2LevelShadow('open');
+testCascadingOrderWith2LevelShadow('closed');
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/imported/w3c/csswg-test/css-scoping-1/w3c-import.log b/LayoutTests/imported/w3c/csswg-test/css-scoping-1/w3c-import.log
new file mode 100644 (file)
index 0000000..8fcf77b
--- /dev/null
@@ -0,0 +1,48 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the W3C CSS or WPT github:
+       https://github.com/w3c/csswg-test
+       https://github.com/w3c/web-platform-tests
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-assigned-node-with-before-after-expected.html
+/LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-assigned-node-with-before-after.html
+/LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-assigned-node-with-rules-expected.html
+/LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-assigned-node-with-rules.html
+/LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-host-functional-rule-expected.html
+/LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-host-functional-rule.html
+/LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-host-rule-expected.html
+/LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-host-rule.html
+/LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-host-with-before-after-expected.html
+/LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-host-with-before-after.html
+/LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-invisible-slot-expected.html
+/LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-invisible-slot.html
+/LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-root-hides-children-expected.html
+/LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-root-hides-children.html
+/LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slot-display-override-expected.html
+/LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slot-display-override.html
+/LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slot-expected.html
+/LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slot-fallback-expected.html
+/LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slot-fallback.html
+/LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slot.html
+/LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slotted-nested-expected.html
+/LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slotted-nested.html
+/LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slotted-rule-expected.html
+/LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slotted-rule.html
+/LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-with-outside-rules-expected.html
+/LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-with-outside-rules.html
+/LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-with-rules-expected.html
+/LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-with-rules-no-style-leak-expected.html
+/LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-with-rules-no-style-leak.html
+/LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-with-rules.html
+/LayoutTests/imported/w3c/csswg-test/css-scoping-1/shadow-cascade-order-001.html