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

Unified Diff: third_party/WebKit/LayoutTests/shadow-dom/shadow-piercing-descendant-combinator-in-static-profile.html

Issue 2532813002: Matching part for >>> (shadow-piercing descendant combinator). (Closed)
Patch Set: Created 4 years, 1 month 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/shadow-piercing-descendant-combinator-in-static-profile.html
diff --git a/third_party/WebKit/LayoutTests/shadow-dom/shadow-piercing-descendant-combinator-in-static-profile.html b/third_party/WebKit/LayoutTests/shadow-dom/shadow-piercing-descendant-combinator-in-static-profile.html
new file mode 100644
index 0000000000000000000000000000000000000000..a2b836445ec750b2f026d29984429e657a3a33dc
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/shadow-dom/shadow-piercing-descendant-combinator-in-static-profile.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="resources/shadow-dom.js"></script>
+<style>
+body >>> #x { color: red; }
+</style>
+<div id="host">
+ <template data-mode="open">
+ <div><span id="x">In the shadow tree.</span></div>
+ </template>
+</div>
+<script>
+convertTemplatesToShadowRootsWithin(host);
+test(() => {
+ var span = document.querySelector('body >>> #x');
+ assert_equals(span.textContent, 'In the shadow tree.',
+ '>>> should work in static profile.');
+
+ var stylesheet = document.styleSheets[0];
+ assert_equals(stylesheet.cssRules.length, 0,
+ 'A selector containing >>> should be discarded in dynamic profile.');
+ assert_equals(window.getComputedStyle(span).color, 'rgb(0, 0, 0)',
+ '>>> in dynamic profile should not match.');
+}, 'deep descendant combinator >>> should work only in static profile.');
+</script>

Powered by Google App Engine
This is Rietveld 408576698