OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | |
4 <script src="resources/link-highlight-helper.js"></script> | 3 <script src="resources/link-highlight-helper.js"></script> |
5 <link rel="stylesheet" type="text/css" href="resources/link-highlight-style.css"
> | |
6 </head> | |
7 <body onload="runTest();"> | 4 <body onload="runTest();"> |
8 <div style="-webkit-transform: translateZ(0); padding: 20px;"> | 5 |
9 <a href="" id="targetLink" class="opaqueHighlight"><img width="320" height="240"
src="resources/dice.png"></a> | 6 <template id="shadow-tree"> |
| 7 <a href="" id="targetLink" style="-webkit-tap-highlight-color: rgb(0, 255, 0)"><
content></content></a> |
| 8 </template> |
| 9 |
| 10 <div id="host" style="-webkit-transform: translateZ(0); padding: 20px;"> |
| 11 <img width="320" height="240" src="resources/dice.png"> |
10 </div> | 12 </div> |
| 13 |
11 <script> | 14 <script> |
| 15 useMockHighlight(); |
| 16 var shadowRoot = document.querySelector('#host').createShadowRoot(); |
| 17 shadowRoot.appendChild(document.importNode(document.querySelector('#shadow-tree'
).content, true)); |
| 18 var targetLink = shadowRoot.querySelector('#targetLink'); |
| 19 |
12 function runTest() { | 20 function runTest() { |
13 useMockHighlight(); | 21 var clientRect = targetLink.getBoundingClientRect(); |
14 var clientRect = document.getElementById('targetLink').getBoundingClientRect
(); | |
15 x = (clientRect.left + clientRect.right) / 2; | 22 x = (clientRect.left + clientRect.right) / 2; |
16 y = (clientRect.top + clientRect.bottom) / 2; | 23 y = (clientRect.top + clientRect.bottom) / 2; |
17 if (window.testRunner) { | 24 if (window.testRunner) { |
18 testRunner.dumpAsTextWithPixelResults(); | 25 testRunner.dumpAsTextWithPixelResults(); |
19 testRunner.waitUntilDone(); | 26 testRunner.waitUntilDone(); |
20 } | 27 } |
21 | 28 |
22 if (window.eventSender) { | 29 if (window.eventSender) { |
23 eventSender.gestureShowPress(x, y); | 30 eventSender.gestureShowPress(x, y); |
24 window.setTimeout(function() { window.testRunner.notifyDone(); }, 0); | 31 window.setTimeout(function() { window.testRunner.notifyDone(); }, 0); |
25 } else { | 32 } else { |
26 debug("This test requires DumpRenderTree."); | 33 debug("This test requires DumpRenderTree."); |
27 debug("This test is successful if the image below is covered in a green
rectangle."); | 34 debug("This test is successful if the image below is covered in a green
box with square ranges."); |
28 } | 35 } |
29 } | 36 } |
30 </script> | 37 </script> |
31 </script> | |
32 </body> | 38 </body> |
33 </html> | 39 </html> |
OLD | NEW |