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

Unified Diff: third_party/WebKit/LayoutTests/shadow-dom/query-selector.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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/shadow-dom/shadow-piercing-descendant-combinator.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/shadow-dom/query-selector.html
diff --git a/third_party/WebKit/LayoutTests/shadow-dom/query-selector.html b/third_party/WebKit/LayoutTests/shadow-dom/query-selector.html
index f67bd66521f8e45374e8e851a8bf20ffe0b28f0f..e9baa4acf9607cb43cc1645176041962eca83523 100644
--- a/third_party/WebKit/LayoutTests/shadow-dom/query-selector.html
+++ b/third_party/WebKit/LayoutTests/shadow-dom/query-selector.html
@@ -2,12 +2,13 @@
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src="resources/shadow-dom.js"></script>
-<div id="x"><span></span></div>
-<div id="x"><span></span></div>
+<div id="x"><span>test1</span></div>
+<div id="x"><span>test2</span></div>
<div id="host">
<template data-mode="open">
<div id="y"><span></span></div>
<div id="y"><span></span></div>
+ <div><span id="x" class="y">Can you find this?</span></div>
</template>
</div>
<script>
@@ -21,4 +22,17 @@ test(() => {
assert_equals(host.shadowRoot.querySelectorAll('#y').length, 2);
assert_equals(host.shadowRoot.querySelectorAll('#y span').length, 2);
}, 'querySelectorAll for multiple #Ids in a shadow tree');
+
+test(() => {
+ var spans = document.querySelectorAll('body >>> #x');
+ assert_equals(spans.length, 3);
+ assert_equals(spans[0].textContent, 'test1');
+ assert_equals(spans[1].textContent, 'test2');
+ assert_equals(spans[2].textContent, 'Can you find this?');
+}, 'deep combinator >>> should work for querySelectorAll.');
+
+test(() => {
+ var span = document.querySelector('body >>> .y');
+ assert_equals(span.textContent, 'Can you find this?');
+}, 'deep combinator >>> should work for querySelector');
</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/shadow-dom/shadow-piercing-descendant-combinator.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698