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

Unified Diff: LayoutTests/fast/dom/shadow/shadow-tree-styles-select-host.html

Issue 317143002: Revert of Remove scoped styles. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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: LayoutTests/fast/dom/shadow/shadow-tree-styles-select-host.html
diff --git a/LayoutTests/fast/dom/shadow/shadow-tree-styles-select-host.html b/LayoutTests/fast/dom/shadow/shadow-tree-styles-select-host.html
index c71bac76e1d95f6c43ae0e327d1a7fb830890b0e..184342a8775e81b59c40f5f268fa3f42dcc3a806 100644
--- a/LayoutTests/fast/dom/shadow/shadow-tree-styles-select-host.html
+++ b/LayoutTests/fast/dom/shadow/shadow-tree-styles-select-host.html
@@ -193,6 +193,28 @@
cleanUp();
+debug('Test the case where there exists a style scoped in a contanining treescope.');
+
+sandbox.appendChild(
+ createDOM('style', {},
+ document.createTextNode('div:last-child { border: 1px solid blue; }')));
+sandbox.appendChild(
+ createDOM('div', {},
+ createDOM('style', {'scoped': 'scoped'},
+ document.createTextNode(':last-child { border: 1px solid red }')),
+ createDOM('div', {'id': 'host'},
+ createShadowRoot(
+ createDOM('style', {},
+ document.createTextNode(':host { border: 1px solid green; }')),
+ createDOM('content', {})),
+ createDOM('div', {'id': 'host-child'},
+ document.createTextNode('Hello, Host!')))));
+
+// Rules from style scoped win, because styles in shadow trees are treated as registered with a root node of a containing treescope.
+shouldHaveBorderColor('host', 'rgb(255, 0, 0)');
+
+cleanUp();
+
debug('Test that style sharing is disabled when styles in shadow trees would match shadow hosts.');
sandbox.appendChild(

Powered by Google App Engine
This is Rietveld 408576698