OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>This test ensures all elements are highlighted in a multielement <a> when
the image is clicked</title> | 4 <title>This test ensures all elements are highlighted in a multielement <a> when
the image is clicked</title> |
5 <style> | 5 <style> |
6 a { text-decoration: none; } | 6 a { text-decoration: none; } |
7 </style> | 7 </style> |
8 </head> | 8 </head> |
9 <body onload="runTest();"> | 9 <body onload="runTest();"> |
10 <div style="-webkit-transform: translateZ(0); padding: 20px;"> | 10 <div style="transform: translateZ(0); padding: 20px;"> |
11 <a href="" id="targetLink" style="-webkit-tap-highlight-color: rgb(0, 255, 0)"> | 11 <a href="" id="targetLink" style="-webkit-tap-highlight-color: rgb(0, 255, 0)"> |
12 <font id="beforeTarget">Before Text</font><img id="imgTarget" width="320" he
ight="240" src="resources/dice.png"><font id="afterTarget">After Text</font> | 12 <font id="beforeTarget">Before Text</font><img id="imgTarget" width="320" he
ight="240" src="resources/dice.png"><font id="afterTarget">After Text</font> |
13 </a> | 13 </a> |
14 </div> | 14 </div> |
15 <script> | 15 <script> |
16 function runTest() { | 16 function runTest() { |
17 var clientRect = document.getElementById('imgTarget').getBoundingClientRect(
); | 17 var clientRect = document.getElementById('imgTarget').getBoundingClientRect(
); |
18 x = (clientRect.left + clientRect.right) / 2; | 18 x = (clientRect.left + clientRect.right) / 2; |
19 y = (clientRect.top + clientRect.bottom) / 2; | 19 y = (clientRect.top + clientRect.bottom) / 2; |
20 if (window.testRunner) { | 20 if (window.testRunner) { |
21 testRunner.dumpAsTextWithPixelResults(); | 21 testRunner.dumpAsTextWithPixelResults(); |
22 testRunner.waitUntilDone(); | 22 testRunner.waitUntilDone(); |
23 } | 23 } |
24 | 24 |
25 if (window.eventSender) { | 25 if (window.eventSender) { |
26 eventSender.gestureShowPress(x, y); | 26 eventSender.gestureShowPress(x, y); |
27 window.setTimeout(function() { window.testRunner.notifyDone(); }, 0); | 27 window.setTimeout(function() { window.testRunner.notifyDone(); }, 0); |
28 } else { | 28 } else { |
29 debug("This test requires DumpRenderTree."); | 29 debug("This test requires DumpRenderTree."); |
30 debug("This test is successful if the image and text below is covered in
a green rectangle."); | 30 debug("This test is successful if the image and text below is covered in
a green rectangle."); |
31 } | 31 } |
32 } | 32 } |
33 </script> | 33 </script> |
34 </script> | 34 </script> |
35 </body> | 35 </body> |
36 </html> | 36 </html> |
OLD | NEW |