| 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>Touch event retargeting.</p> | 9 <p>Touch event retargeting.</p> |
| 10 <div id="sandbox"> | 10 <div id="sandbox"> |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 function addTouchPoint(target) | 38 function addTouchPoint(target) |
| 39 { | 39 { |
| 40 eventSender.addTouchPoint(target.offsetLeft + target.offsetWidth / 2, target
.offsetTop + target.offsetHeight / 2); | 40 eventSender.addTouchPoint(target.offsetLeft + target.offsetWidth / 2, target
.offsetTop + target.offsetHeight / 2); |
| 41 } | 41 } |
| 42 | 42 |
| 43 function sendTouchEvent(elements) | 43 function sendTouchEvent(elements) |
| 44 { | 44 { |
| 45 eventSender.clearTouchPoints(); | 45 eventSender.clearTouchPoints(); |
| 46 for (var i = 0; i < elements.length; ++i) | 46 for (var i = 0; i < elements.length; ++i) |
| 47 addTouchPoint(getNodeInTreeOfTrees(elements[i])); | 47 addTouchPoint(getNodeInComposedTree(elements[i])); |
| 48 eventSender.touchStart(); | 48 eventSender.touchStart(); |
| 49 eventSender.touchEnd(); | 49 eventSender.touchEnd(); |
| 50 } | 50 } |
| 51 | 51 |
| 52 addEventListeners(['div1', 'div2', 'div3', | 52 addEventListeners(['div1', 'div2', 'div3', |
| 53 'div2/div2-shadow-root-child', 'div3/div3-shadow-root-child']
); | 53 'div2/div2-shadow-root-child', 'div3/div3-shadow-root-child']
); |
| 54 sendTouchEvent(['div1', 'div2/div2-shadow-root-child', 'div3/div3-shadow-root-ch
ild']); | 54 sendTouchEvent(['div1', 'div2/div2-shadow-root-child', 'div3/div3-shadow-root-ch
ild']); |
| 55 sortDispatchedEvent('touchstart'); | 55 sortDispatchedEvent('touchstart'); |
| 56 debugDispatchedEvent('touchstart'); | 56 debugDispatchedEvent('touchstart'); |
| 57 </script> | 57 </script> |
| 58 </body> | 58 </body> |
| 59 </html> | 59 </html> |
| OLD | NEW |