OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <link rel="stylesheet" type="text/css" href="resources/link-highlight-style.css"
> | 4 <link rel="stylesheet" type="text/css" href="resources/link-highlight-style.css"
> |
5 </head> | 5 </head> |
6 <body onload="runTest();"> | 6 <body onload="runTest();"> |
7 <div id="highlight" class="fauxHighlight" style="z-index: 1; position: absolute;
"></div> | 7 <div id="highlight" class="fauxHighlight" style="z-index: 1; position: absolute;
"></div> |
8 <div style="top: 10px; left: 10px; -webkit-transform: translateZ(0);"> | 8 <div style="top: 10px; left: 10px; transform: translateZ(0);"> |
9 <div id="targetDiv" style="position: absolute; left: 50px; top: 50px; width: 50p
x; height: 50px; box-shadow: 0px 4px 23px 5px rgba(0, 0, 0, 0.2); border-style:
solid; border-width: 2px;"> | 9 <div id="targetDiv" style="position: absolute; left: 50px; top: 50px; width: 50p
x; height: 50px; box-shadow: 0px 4px 23px 5px rgba(0, 0, 0, 0.2); border-style:
solid; border-width: 2px;"> |
10 <br><center>Target</center><br> | 10 <br><center>Target</center><br> |
11 </div> | 11 </div> |
12 </div> | 12 </div> |
13 <div style="position: absolute; left: 10px; top: 250px; -webkit-transform: trans
lateZ(0);"> | 13 <div style="position: absolute; left: 10px; top: 250px; transform: translateZ(0)
;"> |
14 This test is successful if the box labelled "Target" has a green rectangle cente
red on it. | 14 This test is successful if the box labelled "Target" has a green rectangle cente
red on it. |
15 </div> | 15 </div> |
16 <script> | 16 <script> |
17 function runTest() { | 17 function runTest() { |
18 var clientRect = document.getElementById('targetDiv').getBoundingClientRect(
); | 18 var clientRect = document.getElementById('targetDiv').getBoundingClientRect(
); |
19 var highlight = document.getElementById('highlight'); | 19 var highlight = document.getElementById('highlight'); |
20 | 20 |
21 highlight.style.left = clientRect.left + "px"; | 21 highlight.style.left = clientRect.left + "px"; |
22 highlight.style.top = clientRect.top + "px"; | 22 highlight.style.top = clientRect.top + "px"; |
23 highlight.style.width = clientRect.width + "px"; | 23 highlight.style.width = clientRect.width + "px"; |
24 highlight.style.height = clientRect.height + "px"; | 24 highlight.style.height = clientRect.height + "px"; |
25 | 25 |
26 if (window.testRunner) | 26 if (window.testRunner) |
27 testRunner.dumpAsTextWithPixelResults(); | 27 testRunner.dumpAsTextWithPixelResults(); |
28 } | 28 } |
29 </script> | 29 </script> |
30 </body> | 30 </body> |
31 </html> | 31 </html> |
OLD | NEW |