| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <body> | 3 <body> |
| 4 <div id="console"></div> | 4 <div id="console"></div> |
| 5 <div style="position: relative; width: 2400px; height: 2400px; background-
color: white;"> | 5 <div style="position: relative; width: 2400px; height: 2400px; background-
color: white;"> |
| 6 <div style="position:fixed; left: 50px; top: 30px; width: 200px; height:
250px; background-color: green;"></div> | 6 <div style="position:fixed; left: 50px; top: 30px; width: 200px; height:
250px; background-color: green;"></div> |
| 7 <div style="position:absolute; left: 600px; top: 800px;"> <input id="tex
tbox" type="text"></div> | 7 <div style="position:absolute; left: 600px; top: 800px;"> <input id="tex
tbox" type="text"></div> |
| 8 </div> | 8 </div> |
| 9 </body> | 9 </body> |
| 10 <script src="../js/resources/js-test-pre.js"></script> | 10 <script src="../js/resources/js-test-pre.js"></script> |
| 11 <script> | 11 <script> |
| 12 var box = document.getElementById('textbox'); | 12 var box = document.getElementById('textbox'); |
| 13 if (window.internals) | 13 if (window.internals) |
| 14 window.internals.scrollElementToRect(box, 50, 30, 200, 250); | 14 window.internals.scrollElementToRect(box, 50, 30, 200, 250); |
| 15 | 15 |
| 16 var rect = box.getBoundingClientRect(); | 16 var rect = box.getBoundingClientRect(); |
| 17 var computedLeft = 50 + Math.floor((200 - rect.width) / 2); | 17 var computedLeft = 50 + Math.floor((200 - rect.width) / 2); |
| 18 var computedTop = 30 + Math.floor((250 - rect.height) / 2); | 18 var computedTop = 30 + Math.floor((250 - rect.height) / 2); |
| 19 debug("Scrolled element to rect"); | 19 debug("Scrolled element to rect"); |
| 20 shouldBe("rect.left", "computedLeft"); | 20 shouldBe("rect.left", "computedLeft"); |
| 21 shouldBe("rect.top", "computedTop"); | 21 shouldBe("rect.top", "computedTop"); |
| 22 if (window.testRunner) { | 22 if (window.testRunner) { |
| 23 testRunner.dumpAsText(); | 23 testRunner.dumpAsText(); |
| 24 } | 24 } |
| 25 </script> | 25 </script> |
| 26 <script src="../js/resources/js-test-post.js"></script> | |
| 27 </script> | 26 </script> |
| 28 </head> | 27 </head> |
| 29 </html> | 28 </html> |
| OLD | NEW |