| 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 <link rel="stylesheet" type="text/css" href="resources/link-highlight-style.css"
> | 5 <link rel="stylesheet" type="text/css" href="resources/link-highlight-style.css"
> |
| 6 </head> | 6 </head> |
| 7 <body onload="runTest();"> | 7 <body onload="runTest();"> |
| 8 <div style="-webkit-transform: translateZ(0); position: relative; left: 10; top:
40"> | 8 <div style="transform: translateZ(0); position: relative; left: 10; top: 40"> |
| 9 <a class="opaqueHighlight" href="" id="targetLink">Long Target<br>Link.</a> | 9 <a class="opaqueHighlight" href="" id="targetLink">Long Target<br>Link.</a> |
| 10 </div> | 10 </div> |
| 11 <div style="position: relative; left: 10; top: 70"> | 11 <div style="position: relative; left: 10; top: 70"> |
| 12 This test is successful if "Long Target Link" above is covered in two green rect
angles with square corners. | 12 This test is successful if "Long Target Link" above is covered in two green rect
angles with square corners. |
| 13 </div> | 13 </div> |
| 14 <script> | 14 <script> |
| 15 function runTest() { | 15 function runTest() { |
| 16 var clientRect = document.getElementById('targetLink').getBoundingClientRect
(); | 16 var clientRect = document.getElementById('targetLink').getBoundingClientRect
(); |
| 17 x = (clientRect.left + clientRect.right) / 2; | 17 x = (clientRect.left + clientRect.right) / 2; |
| 18 y = (clientRect.top + clientRect.bottom) / 2; | 18 y = (clientRect.top + clientRect.bottom) / 2; |
| 19 touchWidth = (clientRect.right - clientRect.left) / 4; | 19 touchWidth = (clientRect.right - clientRect.left) / 4; |
| 20 touchHeight = (clientRect.bottom - clientRect.top) / 4; | 20 touchHeight = (clientRect.bottom - clientRect.top) / 4; |
| 21 if (window.testRunner) { | 21 if (window.testRunner) { |
| 22 testRunner.dumpAsTextWithPixelResults(); | 22 testRunner.dumpAsTextWithPixelResults(); |
| 23 testRunner.waitUntilDone(); | 23 testRunner.waitUntilDone(); |
| 24 } | 24 } |
| 25 | 25 |
| 26 if (window.eventSender) { | 26 if (window.eventSender) { |
| 27 eventSender.gestureShowPress(x, y, touchWidth, touchHeight); | 27 eventSender.gestureShowPress(x, y, touchWidth, touchHeight); |
| 28 window.setTimeout(function() { window.testRunner.notifyDone(); }, 0); | 28 window.setTimeout(function() { window.testRunner.notifyDone(); }, 0); |
| 29 } else { | 29 } else { |
| 30 debug("This test requires DumpRenderTree."); | 30 debug("This test requires DumpRenderTree."); |
| 31 } | 31 } |
| 32 } | 32 } |
| 33 </script> | 33 </script> |
| 34 </script> | 34 </script> |
| 35 </body> | 35 </body> |
| 36 </html> | 36 </html> |
| OLD | NEW |