4 <div id=
"console"></div>
5 <div style=
"position: relative; width: 1600px; height: 2400px; background-color: green;">
6 <div style=
"position:absolute; left: 600px; top: 800px;"> <input id=
"textbox" type=
"text"></div>
9 <script src=
"../../resources/js-test.js"></script>
11 var box
= document
.getElementById('textbox');
12 if (window
.internals
) {
13 window
.internals
.scrollElementToRect(box
, 0, 100, 300, 300);
14 window
.internals
.scrollElementToRect(box
, 0, 0, 300, 300);
17 var rect
= box
.getBoundingClientRect();
18 var computedLeft
= Math
.floor((300 - rect
.width
) / 2);
19 var computedTop
= Math
.floor((300 - rect
.height
) / 2);
20 debug("Scrolled element to rect");
21 shouldBe("rect.left", "computedLeft");
22 shouldBe("rect.top", "computedTop");
23 if (window
.testRunner
) {
24 testRunner
.dumpAsText();