| 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/run-after-display.js"></script> |
| 5 </head> | 6 </head> |
| 6 <body onload="runTest();" onclick="doNothing();"> | 7 <body onload="runTest();" onclick="doNothing();"> |
| 7 <div style="-webkit-transform: translateZ(0); position: relative; left: 10px; to
p: 40px"> | 8 <div style="-webkit-transform: translateZ(0); position: relative; left: 10px; to
p: 40px"> |
| 8 <a href="" id="targetLink" style="-webkit-tap-highlight-color: rgba(0, 255, 0, 0
.5)">Target Link.</a> | 9 <a href="" id="targetLink" style="-webkit-tap-highlight-color: rgba(0, 255, 0, 0
.5)">Target Link.</a> |
| 9 </div> | 10 </div> |
| 10 <div style="position: relative; left: 10px; top: 70px"> | 11 <div style="position: relative; left: 10px; top: 70px"> |
| 11 This test is successful if no link highlight appears (in particular, the entire
viewport should remain unchanged, and the background | 12 This test is successful if no link highlight appears (in particular, the entire
viewport should remain unchanged, and the background |
| 12 should be white and not grey). | 13 should be white and not grey). |
| 13 </div> | 14 </div> |
| 14 <script> | 15 <script> |
| 15 // This test makes sure a previous highlight does not survive beyond the next Ge
stureShowPress, even | 16 // This test makes sure a previous highlight does not survive beyond the next Ge
stureShowPress, even |
| 16 // if the new event fails to produce a valid target for highlighting. | 17 // if the new event fails to produce a valid target for highlighting. |
| 17 function runTest() { | 18 function runTest() { |
| 18 var clientRect = document.getElementById('targetLink').getBoundingClientRect
(); | 19 var clientRect = document.getElementById('targetLink').getBoundingClientRect
(); |
| 19 x = (clientRect.left + clientRect.right) / 2; | 20 x = (clientRect.left + clientRect.right) / 2; |
| 20 y = (clientRect.top + clientRect.bottom) / 2; | 21 y = (clientRect.top + clientRect.bottom) / 2; |
| 21 if (window.testRunner) { | 22 if (window.testRunner) { |
| 22 testRunner.dumpAsTextWithPixelResults(); | 23 testRunner.dumpAsTextWithPixelResults(); |
| 23 testRunner.waitUntilDone(); | 24 testRunner.waitUntilDone(); |
| 24 } | 25 } |
| 25 | 26 |
| 26 if (window.eventSender) { | 27 if (window.eventSender) { |
| 27 // Generate valid link highlight. | 28 // Generate valid link highlight. |
| 28 eventSender.gestureShowPress(x, y); | 29 eventSender.gestureShowPress(x, y); |
| 29 window.testRunner.display(); | 30 runAfterDisplay(function() { |
| 30 | 31 // Generate tap in region with no valid target ... this should cance
l the first tap. |
| 31 // Generate tap in region with no valid target ... this should cancel th
e first tap. | 32 eventSender.gestureShowPress(150, 150); |
| 32 eventSender.gestureShowPress(150, 150); | 33 testRunner.notifyDone(); |
| 33 window.setTimeout(function() { window.testRunner.notifyDone(); }, 0); | 34 }); |
| 34 } else { | 35 } else { |
| 35 debug("This test requires DumpRenderTree."); | 36 debug("This test requires DumpRenderTree."); |
| 36 } | 37 } |
| 37 } | 38 } |
| 38 </script> | 39 </script> |
| 39 </script> | 40 </script> |
| 40 </body> | 41 </body> |
| 41 </html> | 42 </html> |
| OLD | NEW |