Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Unified Diff: third_party/WebKit/LayoutTests/shadow-dom/cascade-multiple-shadow-with-host-rules.html

Issue 1803933002: Use correct cascading order for Shadow DOM v1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix enum Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/shadow-dom/cascade-multiple-shadow-with-host-rules.html
diff --git a/third_party/WebKit/LayoutTests/shadow-dom/cascade-multiple-shadow-with-host-rules.html b/third_party/WebKit/LayoutTests/shadow-dom/cascade-multiple-shadow-with-host-rules.html
new file mode 100644
index 0000000000000000000000000000000000000000..e74d90f9535f40e9cc237d3f99565105052b9ce1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/shadow-dom/cascade-multiple-shadow-with-host-rules.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<script src='../resources/testharness.js'></script>
+<script src='../resources/testharnessreport.js'></script>
+<div id='host'></div>
+<div id='dummy'></div>
+<script>
+'use strict';
+
+var root1 = host.createShadowRoot();
+var root2 = host.createShadowRoot();
+
+root1.innerHTML = '<style>:host { color: red; }</style>';
+root2.innerHTML = '<style>:host { background-color: green; }</style>';
+
+test(() => {
+ assert_equals(window.getComputedStyle(host).color, 'rgb(255, 0, 0)');
+ assert_equals(window.getComputedStyle(host).backgroundColor, 'rgb(0, 128, 0)');
+}, 'In case of multiple shadow, :host rules from all shadows should apply.');
+
+dummy.attachShadow({mode: 'open'});
+
+test(() => {
+ assert_equals(window.getComputedStyle(host).color, 'rgb(255, 0, 0)');
+ assert_equals(window.getComputedStyle(host).backgroundColor, 'rgb(0, 128, 0)');
+}, 'After V1 cascade rule is applied, :host rules from V0 multiple shadow should apply.');
+</script>

Powered by Google App Engine
This is Rietveld 408576698