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 sandbox.appendChild( | 15 sandbox.appendChild( |
16 createDOM('div', {'id': 'top'}, | 16 createDOM('div', {'id': 'top'}, |
17 createDOM('div', {'id': 'shadow-host'}, | 17 createDOM('div', {'id': 'shadow-host'}, |
18 createShadowRoot({'id': 'shadow-root'})))); | 18 createShadowRoot({'id': 'shadow-root'})))); |
19 var shadowRoot = getNodeInTreeOfTrees('shadow-host/'); | 19 var shadowRoot = getNodeInComposedTree('shadow-host/'); |
20 shadowRoot.innerHTML = 'Text Nodes'; | 20 shadowRoot.innerHTML = 'Text Nodes'; |
21 addEventListeners(['top', 'shadow-host', 'shadow-host/']); | 21 addEventListeners(['top', 'shadow-host', 'shadow-host/']); |
22 showSandboxTree(); | 22 showSandboxTree(); |
23 | 23 |
24 // Calculates the position of the text node in the shadow root. | 24 // Calculates the position of the text node in the shadow root. |
25 var host = document.getElementById('shadow-host'); | 25 var host = document.getElementById('shadow-host'); |
26 var x = host.offsetLeft + 5; | 26 var x = host.offsetLeft + 5; |
27 var y = host.offsetTop + defaultPaddingSize + 5; | 27 var y = host.offsetTop + defaultPaddingSize + 5; |
28 debug('\n' + 'Moving mouse from a direct child text node of the shadow r
oot to top'); | 28 debug('\n' + 'Moving mouse from a direct child text node of the shadow r
oot to top'); |
29 eventSender.mouseMoveTo(x, y); | 29 eventSender.mouseMoveTo(x, y); |
30 clearEventRecords(); | 30 clearEventRecords(); |
31 | 31 |
32 moveMouseOver(document.getElementById('top')); | 32 moveMouseOver(document.getElementById('top')); |
33 debugDispatchedEvent('mouseout'); | 33 debugDispatchedEvent('mouseout'); |
34 debugDispatchedEvent('mouseover'); | 34 debugDispatchedEvent('mouseover'); |
35 | 35 |
36 touchLocation(host); | 36 touchLocation(host); |
37 debugDispatchedEvent('touchstart'); | 37 debugDispatchedEvent('touchstart'); |
38 | 38 |
39 scrollMouseWheel(host); | 39 scrollMouseWheel(host); |
40 debugDispatchedEvent('mousewheel'); | 40 debugDispatchedEvent('mousewheel'); |
41 </script> | 41 </script> |
42 </body> | 42 </body> |
43 </html> | 43 </html> |
OLD | NEW |