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

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

Issue 2523673002: Add a test for multiple >>>s in a selector. (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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/shadow-dom/shadow-piercing-descendant-combinator.html
diff --git a/third_party/WebKit/LayoutTests/shadow-dom/shadow-piercing-descendant-combinator.html b/third_party/WebKit/LayoutTests/shadow-dom/shadow-piercing-descendant-combinator.html
index 8c75fafb7ef6120f3ee8c8843d480d8eba116521..5f209b386d039c25d734bfe23d90ffe626acf904 100644
--- a/third_party/WebKit/LayoutTests/shadow-dom/shadow-piercing-descendant-combinator.html
+++ b/third_party/WebKit/LayoutTests/shadow-dom/shadow-piercing-descendant-combinator.html
@@ -3,6 +3,7 @@
<script src="../resources/testharnessreport.js"></script>
<script src="resources/shadow-dom.js"></script>
<body>
+
<div id="testroot">
<div id="openhost">
<template data-mode="open">
@@ -41,8 +42,30 @@
</template>
</div>
</div>
+
+ <div id="testroot2">
+ <template data-mode="open">
+ <div id="div1">
+ <template data-mode="open">
+ <div id="div2">
+ <template data-mode="open">
+ <div id="div3">
+ <template data-mode="open" data-expose-as="deepestRoot">
+ <div id="div4">
+ </div>
+ </template>
+ </div>
+ </template>
+ </div>
+ </template>
+ </div>
+ </template>
+ </div>
+
</body>
<script>
+'use strict';
+
convertTemplatesToShadowRootsWithin(testroot);
test(() => {
assert_equals(document.querySelectorAll('body >>> #inner-open').length, 1);
@@ -69,4 +92,16 @@ test(() => {
assert_equals(document.querySelector('#testroot >>> #v0host').id, 'v0host');
}, '>>> should match without piercing through shadow roots.');
+test(() => {
+ convertTemplatesToShadowRootsWithin(testroot2);
+ let div4 = deepestRoot.querySelector('#div4');
+
+ assert_equals(document.querySelector('body >>> #div1 >>> #div2 >>> #div3 >>> #div4'), div4);
+ assert_equals(document.querySelector('body >>> #div1 >>> #div2 >>> #div4'), div4);
+ assert_equals(document.querySelector('body >>> #div1 >>> #div3 >>> #div4'), div4);
+ assert_equals(document.querySelector('body >>> #div1 >>> #div4'), div4);
+ assert_equals(document.querySelector('body >>> #div2 >>> #div4'), div4);
+ assert_equals(document.querySelector('#div1 >>> #div2 >>> #div3 >>> #div4'), null,
+ 'leftmost compound should match an element in the same node tree as context object.');
+}, 'Multiple >>>s in a selector should work.');
</script>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698