OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../../resources/js-test.js"></script> | 4 <script src="../../../resources/js-test.js"></script> |
5 <script src="resources/shadow-dom.js"></script> | 5 <script src="resources/shadow-dom.js"></script> |
6 </head> | 6 </head> |
7 <body> | 7 <body> |
8 <p id="description"></p> | 8 <p id="description"></p> |
9 <div id="sandbox"> | 9 <div id="sandbox"> |
10 <details id="details"> | 10 <details id="details"> |
11 <div id="details-child"></div> | 11 <div id="details-child"></div> |
12 <summary id="summary"> | 12 <summary id="summary"> |
13 <div id="summary-child"></div> | 13 <div id="summary-child"></div> |
14 </summary> | 14 </summary> |
15 </details> | 15 </details> |
16 </div> | 16 </div> |
17 <pre id="console"></pre> | 17 <pre id="console"></pre> |
18 <script> | 18 <script> |
19 ['sandbox', 'details', 'details-child', 'summary', 'summary-child'].forEach(func
tion(path) { | 19 ['sandbox', 'details', 'details-child', 'summary', 'summary-child'].forEach(func
tion(path) { |
20 getNodeInTreeOfTrees(path).addEventListener('click', function(event) { | 20 getNodeInComposedTree(path).addEventListener('click', function(event) { |
21 debug('\nevent.path on node ' + dumpNode(event.currentTarget)); | 21 debug('\nevent.path on node ' + dumpNode(event.currentTarget)); |
22 debug(dumpNodeList(event.path)); | 22 debug(dumpNodeList(event.path)); |
23 }); | 23 }); |
24 }); | 24 }); |
25 var clickEvent = document.createEvent("MouseEvents"); | 25 var clickEvent = document.createEvent("MouseEvents"); |
26 clickEvent.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, fa
lse, false, false, 0, null); | 26 clickEvent.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, fa
lse, false, false, 0, null); |
27 | 27 |
28 debug("\nDispaching a click event on #details-child"); | 28 debug("\nDispaching a click event on #details-child"); |
29 document.getElementById('details-child').dispatchEvent(clickEvent); | 29 document.getElementById('details-child').dispatchEvent(clickEvent); |
30 | 30 |
31 debug("\nDispaching a click event on #summary-child"); | 31 debug("\nDispaching a click event on #summary-child"); |
32 document.getElementById('summary-child').dispatchEvent(clickEvent); | 32 document.getElementById('summary-child').dispatchEvent(clickEvent); |
33 </script> | 33 </script> |
34 </body> | 34 </body> |
35 </html> | 35 </html> |
OLD | NEW |