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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/shadow/v1-slots-api-dynamic.html

Issue 1681683005: Set distribution recalc flag when a slot assignment changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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/dom/shadow/SlotAssignment.cpp » ('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-api-dynamic.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/v1-slots-api-dynamic.html b/third_party/WebKit/LayoutTests/fast/dom/shadow/v1-slots-api-dynamic.html
new file mode 100644
index 0000000000000000000000000000000000000000..5d51a088946ff107b36b221d01c36441d1d0a86f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/v1-slots-api-dynamic.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='d1'>
+ <template data-mode='open' data-expose-as='d1_shadow'>
+ <div id='d1-d1'>
+ <template data-mode='open' data-expose-as='d1_d1_shadow'>
+ <slot name='d1-d1-s1'></slot>
+ </template>
+ <slot name='d1-s1' slot='d1-d1-s1'></slot>
+ </div>
+ </template>
+ <div id='d2' slot='d1-s1'></div>
+</div>
+<script>
+'use strict';
+convertTemplatesToShadowRootsWithin(d1);
+removeWhiteSpaceOnlyTextNodes(d1);
+
+test(() => {
+ const d1_s1 = d1_shadow.querySelector('slot');
+ const d1_d1_s1 = d1_d1_shadow.querySelector('slot');
+
+ assert_array_equals(d1_s1.getAssignedNodes(), [d2]);
+ assert_array_equals(d1_s1.getAssignedNodes({'flatten': true}), [d2]);
+
+ assert_array_equals(d1_d1_s1.getAssignedNodes(), [d1_s1]);
+ assert_array_equals(d1_d1_s1.getAssignedNodes({'flatten': true}), [d2]);
+
+ const d3 = document.createElement('div');
+ d3.setAttribute('id', 'd3');
+ d3.setAttribute('slot', 'd1-s1');
+ d1.appendChild(d3);
+
+ assert_array_equals(d1_s1.getAssignedNodes(), [d2, d3]);
+ assert_array_equals(d1_s1.getAssignedNodes({'flatten': true}), [d2, d3]);
+
+ assert_array_equals(d1_d1_s1.getAssignedNodes(), [d1_s1]);
+ assert_array_equals(d1_d1_s1.getAssignedNodes({'flatten': true}), [d2, d3]);
+}, "Distribution should be re-calcualted when assigned nodes of a slot in the parent tree is changed");
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/shadow/SlotAssignment.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698