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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/shadow/v1-slots-in-document-tree.html

Issue 1590533006: Support Slot.getAssignedNodes({flatten: true}) in a document tree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@v1-descendant-slots
Patch Set: rebased 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLSlotElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/dom/shadow/v1-slots-in-document-tree.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/v1-slots-in-document-tree.html b/third_party/WebKit/LayoutTests/fast/dom/shadow/v1-slots-in-document-tree.html
new file mode 100644
index 0000000000000000000000000000000000000000..926d7f58dc3e9fb12a04ee2c36fa9813c67e5285
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/v1-slots-in-document-tree.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<script src='../../../resources/testharness.js'></script>
+<script src='../../../resources/testharnessreport.js'></script>
+<script src='resources/shadow-dom.js'></script>
+<div id='wrapper'>
+ <slot id='slot1'></slot>
+ <slot id='slot2'>
+ <div id='child1'></div>
+ </slot>
+ <slot id='slot3'>
+ <div id='child2'></div>
+ <slot id='slot4'>
+ <div id='child3'></div>
+ <div id='child4'></div>
+ </slot>
+ </slot>
+</div>
+<script>
+'use strict';
+removeWhiteSpaceOnlyTextNodes(wrapper);
+
+test(() => {
+ assert_equals(child1.assignedSlot, null);
+ assert_equals(child2.assignedSlot, null);
+ assert_equals(child3.assignedSlot, null);
+ assert_equals(child4.assignedSlot, null);
+}, "assignedSlot");
+
+test(() => {
+ assert_array_equals(slot1.getAssignedNodes(), []);
+ assert_array_equals(slot2.getAssignedNodes(), []);
+ assert_array_equals(slot3.getAssignedNodes(), []);
+ assert_array_equals(slot4.getAssignedNodes(), []);
+}, "getAssignedNodes");
+
+test(() => {
+ assert_array_equals(slot1.getAssignedNodes({flatten: true}), []);
+ assert_array_equals(slot2.getAssignedNodes({flatten: true}), [child1]);
+ assert_array_equals(slot3.getAssignedNodes({flatten: true}), [child2, child3, child4]);
+ assert_array_equals(slot4.getAssignedNodes({flatten: true}), [child3, child4]);
+}, "getAssignedNodes({flatten: true})");
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLSlotElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698