4 <div id=
"console"></div>
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>
7 <div style=
"position:absolute; left: 600px; top: 800px;"> <input id=
"textbox" type=
"text"></div>
10 <script src=
"../../resources/js-test.js"></script>
12 var box
= document
.getElementById('textbox');
14 window
.internals
.scrollElementToRect(box
, 50, 30, 200, 250);
16 var rect
= box
.getBoundingClientRect();
17 var computedLeft
= 50 + Math
.floor((200 - rect
.width
) / 2);
18 var computedTop
= 30 + Math
.floor((250 - rect
.height
) / 2);
19 debug("Scrolled element to rect");
20 shouldBe("rect.left", "computedLeft");
21 shouldBe("rect.top", "computedTop");
22 if (window
.testRunner
) {
23 testRunner
.dumpAsText();