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

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..5b9235de82a88549aafa41c1fcd0d783b432e61b 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,22 @@ async_test((test) => {
let n = createTestTree(test1);
removeWhiteSpaceOnlyTextNodes(n.test1);
+ n.shadowroot.addEventListener('slotchange', test.step_func((e) => {
kochi 2016/09/02 02:57:06 nit: you can use test.step_func_done(...) and remo
hayato 2016/09/02 04:08:10 Done.
+ assert_true(event.bubbles, 'A slotchange should be a bubble event');
+ assert_false(event.composed, 'A slotchange should be a non-composed event')
+ assert_equals(event.target, n.s1);
+ test.done();
+ }))
+
+ let d1 = document.createElement('div');
+ d1.setAttribute('slot', 'slot1');
+ n.host1.appendChild(d1);
+}, 'A slotchange event shoud be a bubble, non-composed event.');
kochi 2016/09/02 02:57:06 nit: s/bubble/bubbling/
hayato 2016/09/02 04:08:10 Done
+
+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