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

Unified Diff: third_party/WebKit/LayoutTests/fast/selectors/querySelector-pseudo-slotted.html

Issue 1575363006: Implement matching part of ::slotted() pseudo element (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@blink_slotted_parser
Patch Set: rebase Created 4 years, 11 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/fast/selectors/querySelector-pseudo-slotted.html
diff --git a/third_party/WebKit/LayoutTests/fast/selectors/querySelector-pseudo-slotted.html b/third_party/WebKit/LayoutTests/fast/selectors/querySelector-pseudo-slotted.html
new file mode 100644
index 0000000000000000000000000000000000000000..331d91f80191a21dc1bd0192a70a3315472cd739
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/selectors/querySelector-pseudo-slotted.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../dom/shadow/resources/shadow-dom.js"></script>
+<div id="host1">
+ <template data-mode="open">
+ <slot name="slot1"></slot>
+ </template>
+ <span slot="slot1" id="span1"></span>
+ <span slot="slot1" id="span2"></span>
+</div>
+<script>
+convertTemplatesToShadowRootsWithin(host1);
+document.body.offsetLeft;
+
+test(() => {
+ assert_equals(document.querySelector('::slotted(span)'), null);
+ assert_equals(host1.shadowRoot.querySelector('::slotted(span)'), null);
+}, "querySelector for ::slotted pseudo element");
+
+test(() => {
+ assert_equals(document.querySelectorAll('::slotted(span)').length, 0);
+ assert_equals(host1.shadowRoot.querySelectorAll('::slotted(span)').length, 0);
+}, "querySelectorAll for ::slotted pseudo element");
+</script>

Powered by Google App Engine
This is Rietveld 408576698