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> |
| 6 a { text-decoration: none; } |
| 7 </style> |
5 </head> | 8 </head> |
6 <body onload="runTest();"> | 9 <body onload="runTest();"> |
7 <div style="-webkit-transform: translateZ(0); padding: 20px;"> | 10 <div style="-webkit-transform: translateZ(0); padding: 20px;"> |
8 <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)"> |
9 <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> |
10 </a> | 13 </a> |
11 </div> | 14 </div> |
12 <script> | 15 <script> |
13 function runTest() { | 16 function runTest() { |
14 var clientRect = document.getElementById('imgTarget').getBoundingClientRect(
); | 17 var clientRect = document.getElementById('imgTarget').getBoundingClientRect(
); |
15 x = (clientRect.left + clientRect.right) / 2; | 18 x = (clientRect.left + clientRect.right) / 2; |
16 y = (clientRect.top + clientRect.bottom) / 2; | 19 y = (clientRect.top + clientRect.bottom) / 2; |
17 if (window.testRunner) { | 20 if (window.testRunner) { |
18 testRunner.dumpAsTextWithPixelResults(); | 21 testRunner.dumpAsTextWithPixelResults(); |
19 testRunner.waitUntilDone(); | 22 testRunner.waitUntilDone(); |
20 } | 23 } |
21 | 24 |
22 if (window.eventSender) { | 25 if (window.eventSender) { |
23 eventSender.gestureShowPress(x, y); | 26 eventSender.gestureShowPress(x, y); |
24 window.setTimeout(function() { window.testRunner.notifyDone(); }, 0); | 27 window.setTimeout(function() { window.testRunner.notifyDone(); }, 0); |
25 } else { | 28 } else { |
26 debug("This test requires DumpRenderTree."); | 29 debug("This test requires DumpRenderTree."); |
27 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."); |
28 } | 31 } |
29 } | 32 } |
30 </script> | 33 </script> |
31 </script> | 34 </script> |
32 </body> | 35 </body> |
33 </html> | 36 </html> |
OLD | NEW |