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

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

Issue 1523843004: Add support for new CSS ::slotted() pseudo element (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tentative fix for crash / querySelector test 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..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>

Powered by Google App Engine
This is Rietveld 408576698