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