OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../fast/js/resources/js-test-pre.js"></script> | 4 <script src="../../fast/js/resources/js-test-pre.js"></script> |
5 </head> | 5 </head> |
6 <body onload="runTest();"> | 6 <body onload="runTest();"> |
7 <div style="-webkit-transform: translateZ(0); position: relative; left: 10; top:
40"> | 7 <div style="-webkit-transform: translateZ(0); position: relative; left: 10; top:
40"> |
8 <a href="" id="targetLink" style="-webkit-tap-highlight-color: rgba(0, 255, 0, 0
.5)">Long Target<br>Link.</a> | 8 <a href="" id="targetLink1" style="-webkit-tap-highlight-color: rgba(0, 255, 0,
0.5)">Link 1</a><br> |
| 9 <a href="" id="targetLink2" style="-webkit-tap-highlight-color: rgba(0, 255, 0,
0.5)">Link 2</a> |
9 </div> | 10 </div> |
10 <div style="position: relative; left: 10; top: 70"> | 11 <div style="position: relative; left: 10; top: 70"> |
11 This test is successful if "Long Target Link" above is covered in two transparen
t green rectangles with square corners. | 12 This test is successful if "Link 1" and "Link 2" above are covered in two transp
arent green rectangles with square corners. |
12 </div> | 13 </div> |
13 <script> | 14 <script> |
14 function runTest() { | 15 function runTest() { |
15 var clientRect = document.getElementById('targetLink').getBoundingClientRect
(); | 16 var clientRect = document.getElementById('targetLink1').getBoundingClientRec
t(); |
16 x = (clientRect.left + clientRect.right) / 2; | 17 x = (clientRect.left + clientRect.right) / 2; |
17 y = (clientRect.top + clientRect.bottom) / 2; | 18 y = clientRect.bottom; |
18 touchWidth = (clientRect.right - clientRect.left) / 4; | 19 touchWidth = (clientRect.right - clientRect.left) / 4; |
19 touchHeight = (clientRect.bottom - clientRect.top) / 4; | 20 touchHeight = (clientRect.bottom - clientRect.top) / 2; |
20 if (window.testRunner) { | 21 if (window.testRunner) { |
21 testRunner.dumpAsText(true); | 22 testRunner.dumpAsText(true); |
22 testRunner.waitUntilDone(); | 23 testRunner.waitUntilDone(); |
23 } | 24 } |
24 | 25 |
25 if (window.eventSender) { | 26 if (window.eventSender) { |
26 eventSender.gestureTapDown(x, y, touchWidth, touchHeight); | 27 eventSender.gestureTap(x, y, touchWidth, touchHeight); |
27 window.setTimeout(function() { window.testRunner.notifyDone(); }, 0); | 28 window.setTimeout(function() { window.testRunner.notifyDone(); }, 0); |
28 } else { | 29 } else { |
29 debug("This test requires DumpRenderTree."); | 30 debug("This test requires DumpRenderTree."); |
30 } | 31 } |
31 } | 32 } |
32 </script> | 33 </script> |
33 </script> | 34 </script> |
34 </body> | 35 </body> |
35 </html> | 36 </html> |
OLD | NEW |