Index: third_party/WebKit/LayoutTests/shadow-dom/slotchange-node-removed.html |
diff --git a/third_party/WebKit/LayoutTests/shadow-dom/slotchange-node-removed.html b/third_party/WebKit/LayoutTests/shadow-dom/slotchange-node-removed.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..efcf92ab28c9da0b58a2e78ffc438265d16c22b5 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/shadow-dom/slotchange-node-removed.html |
@@ -0,0 +1,35 @@ |
+<!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'> |
+ <slot name='d1-s1'></slot> |
+ </template> |
+ <div id='d2' slot='d1-s1'></div> |
+</div> |
+<script> |
+'use strict'; |
+convertTemplatesToShadowRootsWithin(d1); |
+removeWhiteSpaceOnlyTextNodes(d1); |
+ |
+async_test((test) => { |
+ |
+ const d1_s1 = d1_shadow.querySelector('slot'); |
+ |
+ assert_array_equals(d1_s1.assignedNodes(), [d2]); |
+ assert_array_equals(d1_s1.assignedNodes({'flatten': true}), [d2]); |
+ |
+ d1_s1.addEventListener('slotchange', (e) => { |
+ test.step(() => { |
+ assert_equals(e.target, d1_s1); |
+ assert_array_equals(d1_s1.assignedNodes(), []); |
+ assert_array_equals(d1_s1.assignedNodes({'flatten': true}), []); |
+ assert_equals(e.scoped, true); |
+ test.done(); |
+ }); |
+ }); |
+ |
+ d2.remove(); |
+}, "slotchange event caused by removing a node"); |
+</script> |