OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <style> | 3 <style> |
4 .box { | 4 .box { |
5 width: 100px; | 5 width: 100px; |
6 height: 100px; | 6 height: 100px; |
7 background-color: red; | 7 background-color: red; |
8 position: absolute; | 8 position: absolute; |
9 top: 60px; | 9 top: 60px; |
10 left: 40px; | 10 left: 40px; |
11 } | 11 } |
12 </style> | 12 </style> |
13 <script type="text/javascript"> | 13 <script type="text/javascript"> |
14 | 14 |
15 function checkPosition(id) { | 15 function checkPosition(id) { |
16 var element = document.getElementById(id); | 16 var element = document.getElementById(id); |
17 var y = webkitConvertPointFromNodeToPage(element, new WebKitPoint(0,0)).y; | 17 var y = element.getBoundingClientRect().top; |
18 | 18 |
19 var resultString = ''; | 19 var resultString = ''; |
20 if (y > 250) { | 20 if (y > 250) { |
21 resultString += "PASS - Element " + id + " moved past y=250px"; | 21 resultString += "PASS - Element " + id + " moved past y=250px"; |
22 } else { | 22 } else { |
23 resultString += "FAIL - Element " + id + " still at y=" + y + "px"; | 23 resultString += "FAIL - Element " + id + " still at y=" + y + "px"; |
24 } | 24 } |
25 | 25 |
26 var div = document.createElement("div"); | 26 var div = document.createElement("div"); |
27 div.appendChild(document.createTextNode(resultString)); | 27 div.appendChild(document.createTextNode(resultString)); |
(...skipping 25 matching lines...) Expand all Loading... |
53 function move() { | 53 function move() { |
54 document.getElementById('a').style.top = "300px"; | 54 document.getElementById('a').style.top = "300px"; |
55 document.getElementById('a').style.webkitTransform = "rotate(45deg)"; | 55 document.getElementById('a').style.webkitTransform = "rotate(45deg)"; |
56 document.getElementById('b').style.top = "300px"; | 56 document.getElementById('b').style.top = "300px"; |
57 document.getElementById('b').style.webkitTransform = "rotate(90deg)"; | 57 document.getElementById('b').style.webkitTransform = "rotate(90deg)"; |
58 setTimeout(runTest, 0); | 58 setTimeout(runTest, 0); |
59 } | 59 } |
60 </script> | 60 </script> |
61 </body> | 61 </body> |
62 </html> | 62 </html> |
OLD | NEW |