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

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

Issue 2420043002: Stop re-signaling a slotchange event (Closed)
Patch Set: rebased Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Node.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script> 2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script> 3 <script src="../resources/testharnessreport.js"></script>
4 <script src="resources/shadow-dom.js"></script> 4 <script src="resources/shadow-dom.js"></script>
5 5
6 <div id="test1"> 6 <div id="test1">
7 <div id="host1"> 7 <div id="host1">
8 <template id="shadowroot" data-mode="open"> 8 <template id="shadowroot" data-mode="open">
9 <slot id="s1" name="slot1"></slot> 9 <slot id="s1" name="slot1"></slot>
10 </template> 10 </template>
11 <div id="c1" slot="slot1"></div> 11 <div id="c1" slot="slot1"></div>
12 </div> 12 </div>
13 </div> 13 </div>
14 14
15 <script> 15 <script>
16 function doneIfSlotChange(slots, test) { 16 function doneIfSlotChange(slots, test) {
17 let fired = new Set(); 17 let fired = new Set();
18 for (let slot of slots) { 18 for (let slot of slots) {
19 slot.addEventListener('slotchange', test.step_func((e) => { 19 slot.addEventListener('slotchange', test.step_func((e) => {
20 if (e.target != slot)
21 return;
22 assert_false(fired.has(slot.id)); 20 assert_false(fired.has(slot.id));
23 fired.add(slot.id); 21 fired.add(slot.id);
24 if (fired.size == slots.length) { 22 if (fired.size == slots.length) {
25 test.done(); 23 test.done();
26 } 24 }
27 })) 25 }))
28 } 26 }
29 } 27 }
30 28
31 async_test((test) => { 29 async_test((test) => {
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 async_test((test) => { 302 async_test((test) => {
305 let n = createTestTree(test7); 303 let n = createTestTree(test7);
306 removeWhiteSpaceOnlyTextNodes(n.test7); 304 removeWhiteSpaceOnlyTextNodes(n.test7);
307 305
308 document.body.offsetLeft; 306 document.body.offsetLeft;
309 doneIfSlotChange([n.s1, n.s2, n.s3], test); 307 doneIfSlotChange([n.s1, n.s2, n.s3], test);
310 308
311 n.c1.remove(); 309 n.c1.remove();
312 }, "slotchange event: Fallback slot's parant slot is assinged to another slot.") ; 310 }, "slotchange event: Fallback slot's parant slot is assinged to another slot.") ;
313 </script> 311 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698