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 <script src="resources/event-dispatching.js"></script> | 6 <script src="resources/event-dispatching.js"></script> |
7 </head> | 7 </head> |
8 <body> | 8 <body> |
9 <p id="description"></p> | 9 <p id="description"></p> |
10 <div id="sandbox"></div> | 10 <div id="sandbox"></div> |
11 <pre id="console"></pre> | 11 <pre id="console"></pre> |
12 <script> | 12 <script> |
13 var sandbox = document.getElementById('sandbox'); | 13 var sandbox = document.getElementById('sandbox'); |
14 | 14 |
15 // Makes sure an insertion point can receive a event when a distributed
text node is clicked. | 15 // Makes sure the parent of the insertion point can receive an event whe
n a distributed text node is clicked. |
16 sandbox.appendChild( | 16 sandbox.appendChild( |
17 createDOM('div', {'id': 'top'}, | 17 createDOM('div', {'id': 'top'}, |
18 createDOM('div', {'id': 'shadow-host'}, | 18 createDOM('div', {'id': 'shadow-host'}, |
19 createShadowRoot({'id': 'shadow-root'}, | 19 createShadowRoot({'id': 'shadow-root'}, |
20 createDOM('content', {'id': 'co
ntent'})), | 20 createDOM('div', {'id': 'conten
t-parent'}, |
| 21 createDOM('content',
{'id': 'content'}))), |
21 document.createTextNode('Text Node')))); | 22 document.createTextNode('Text Node')))); |
22 addEventListeners(['top', 'shadow-host', 'shadow-host/', 'shadow-host/co
ntent']); | 23 addEventListeners(['top', 'shadow-host', 'shadow-host/', 'shadow-host/co
ntent-parent', 'shadow-host/content']); |
23 showSandboxTree(); | 24 showSandboxTree(); |
24 | 25 |
25 // Calculates the position of the text node. | 26 // Calculates the position of the text node. |
26 var host = document.getElementById('shadow-host'); | 27 var host = document.getElementById('shadow-host'); |
27 var x = host.offsetLeft + 5; | 28 var x = host.offsetLeft + 5; |
28 var y = host.offsetTop + defaultPaddingSize + 5; | 29 var y = host.offsetTop + defaultPaddingSize + 5; |
29 debug('\n' + 'Moving mouse from a distributed text node to top'); | 30 debug('\n' + 'Moving mouse from a distributed text node to top'); |
30 eventSender.mouseMoveTo(x, y); | 31 eventSender.mouseMoveTo(x, y); |
31 clearEventRecords(); | 32 clearEventRecords(); |
32 | 33 |
33 moveMouseOver(document.getElementById('top')); | 34 moveMouseOver(document.getElementById('top')); |
34 debugDispatchedEvent('mouseout'); | 35 debugDispatchedEvent('mouseout'); |
35 debugDispatchedEvent('mouseover'); | 36 debugDispatchedEvent('mouseover'); |
36 | 37 |
37 clearEventRecords(); | 38 clearEventRecords(); |
38 scrollMouseWheel(host); | 39 scrollMouseWheel(host); |
39 debugDispatchedEvent('mousewheel'); | 40 debugDispatchedEvent('mousewheel'); |
40 | 41 |
41 clearEventRecords(); | 42 clearEventRecords(); |
42 touchLocation(host); | 43 touchLocation(host); |
43 debugDispatchedEvent('touchstart'); | 44 debugDispatchedEvent('touchstart'); |
44 </script> | 45 </script> |
45 </body> | 46 </body> |
46 </html> | 47 </html> |
OLD | NEW |