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"></div> |
| 10 <pre id="console"></pre> |
| 11 <script> |
| 12 var sandbox = document.getElementById('sandbox'); |
| 13 |
| 14 // The following DOM tree came from the picture I've drawn on a whiteboard. |
| 15 // https://chromium.googlecode.com/issues/attachment?aid=2340300011000&name=IMG_
20130508_160406.jpg&token=GBf6WauXYBNwzm3iC2p9qdtsPUQ%3A1367996888205&inline=1 |
| 16 sandbox.appendChild( |
| 17 createDOM('div', {'id': 'A'}, |
| 18 createDOM('div', {'id': 'B'}, |
| 19 createDOM('div', {'id': 'C'})), |
| 20 createShadowRoot({'id': 'D'}, |
| 21 createDOM('div', {'id': 'E'}, |
| 22 createDOM('content', {'id': 'F'}), |
| 23 createShadowRoot({'id': 'G'}, |
| 24 createDOM('div', {'id'
: 'H'}, |
| 25 createDOM('d
iv', {'id': 'I'}, |
| 26 cr
eateDOM('content', {'id': 'J'})), |
| 27 createShadow
Root({'id': 'K'}, |
| 28
createDOM('div', {'id': 'L'}, |
| 29
createDOM('content', {'id': 'M'}))))))))); |
| 30 |
| 31 ['A', 'B', 'C', 'A/', 'A/E', 'A/F', 'A/E/', 'A/E/H', 'A/E/I', 'A/E/J', 'A/E/H/',
'A/E/H/L', 'A/E/H/M'].forEach(function(path) { |
| 32 getNodeInShadowTreeStack(path).addEventListener('click', function(event) { |
| 33 debug('\nevent.path() on node ' + dumpNode(event.currentTarget)); |
| 34 debug(dumpNodeList(event.path())); |
| 35 }); |
| 36 }); |
| 37 var clickEvent = document.createEvent("MouseEvents"); |
| 38 clickEvent.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, fa
lse, false, false, 0, null); |
| 39 document.getElementById('C').dispatchEvent(clickEvent); |
| 40 </script> |
| 41 <script src="../../js/resources/js-test-post.js"></script> |
| 42 </body> |
| 43 </html> |
OLD | NEW |