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..821da8318f48a723759b6c34e2a02c5dbec80bc6 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/fast/selectors/querySelector-pseudo-slotted.html |
@@ -0,0 +1,29 @@ |
+<!DOCTYPE html> |
+<html> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<script src="../dom/shadow/resources/shadow-dom.js"></script> |
+<body> |
+<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> |
+</body> |
+</html> |