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