6 if (!window
.testRunner
|| !window
.eventSender
|| !window
.internals
)
8 testRunner
.dumpAsText();
10 var range
= document
.createRange();
11 range
.selectNodeContents(document
.getElementById('div'));
12 var rectList
= range
.getClientRects();
13 var rect
= rectList
[0];
15 window
.internals
.setPageScaleFactor(2);
16 var scaledRange
= document
.createRange();
17 scaledRange
.selectNodeContents(document
.getElementById('div'));
18 var scaledRectList
= scaledRange
.getClientRects();
19 var scaledRect
= scaledRectList
[0];
21 var result
= document
.getElementById("result");
22 if (rect
.left
== scaledRect
.left
&&
23 rect
.top
== scaledRect
.top
&&
24 rect
.right
== scaledRect
.right
&&
25 rect
.bottom
== scaledRect
.bottom
)
26 result
.innerHTML
= "Pass";
28 result
.innerHTML
= "Fail";
33 <body onload=
"testRects();">
34 <div id=
"div" style=
"width:100px; height:100px; background-color:green;"></div>
35 <p id=
"result">This test must be run via DumpRenderTree.
</p>