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

Unified Diff: third_party/WebKit/LayoutTests/shadow-dom/slotchange.html

Issue 2306873002: Make slotchange events bubble (Closed)
Patch Set: fix Created 4 years, 3 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.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/shadow-dom/slotchange.html
diff --git a/third_party/WebKit/LayoutTests/shadow-dom/slotchange.html b/third_party/WebKit/LayoutTests/shadow-dom/slotchange.html
index 6dcd9a9a184162ab4e9cda8152d50e52eb73de3d..7747bdc5b4701069f82a2f970256d75f4790ad77 100644
--- a/third_party/WebKit/LayoutTests/shadow-dom/slotchange.html
+++ b/third_party/WebKit/LayoutTests/shadow-dom/slotchange.html
@@ -5,7 +5,7 @@
<div id="test1">
<div id="host1">
- <template data-mode="open">
+ <template id="shadowroot" data-mode="open">
<slot id="s1" name="slot1"></slot>
</template>
<div id="c1" slot="slot1"></div>
@@ -30,6 +30,21 @@ async_test((test) => {
let n = createTestTree(test1);
removeWhiteSpaceOnlyTextNodes(n.test1);
+ n.shadowroot.addEventListener('slotchange', test.step_func_done((e) => {
+ assert_true(event.bubbles, 'A slotchange should be a bubbling event');
+ assert_false(event.composed, 'A slotchange should be a non-composed event')
+ assert_equals(event.target, n.s1);
+ }))
+
+ let d1 = document.createElement('div');
+ d1.setAttribute('slot', 'slot1');
+ n.host1.appendChild(d1);
+}, 'A slotchange event shoud be a bubble, non-composed event.');
+
+async_test((test) => {
+ let n = createTestTree(test1);
+ removeWhiteSpaceOnlyTextNodes(n.test1);
+
doneIfSlotChange([n.s1], test);
let d1 = document.createElement('div');
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLSlotElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698