Use testRunner instead of layoutTestController in fast/doctypes, dom, dynamic, encodi...
[WebKit-https.git] / LayoutTests / fast / dom / Range / scale-page-bounding-client-rect.html
1 <html>
2 <head>
3 <script>
4 function testRects()
5 {
6     if (!window.testRunner || !window.internals)
7         return;
8     testRunner.dumpAsText();
9
10     var range = document.createRange();
11     range.selectNodeContents(document.getElementById('div'));
12     var rect = range.getBoundingClientRect();
13    
14     window.internals.settings.setPageScaleFactor(2, 0, 0);
15     var scaledRange = document.createRange();
16     scaledRange.selectNodeContents(document.getElementById('div'));
17     var scaledRect = scaledRange.getBoundingClientRect();
18
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";
25     else
26         result.innerHTML = "Fail";
27     
28 }
29 </script>
30 </head>
31
32 <body onload="testRects();">
33     <div id="div" style="width:100px; height:100px; background-color:green;"></div>
34     <p id="result">This test must be run via DumpRenderTree.</p>
35 </body>
36 </html>