Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / zoom-body-scroll.html
blob24b8ff644e26057aa2955b043c6e09b9da48622d
1 <!DOCTYPE HTML>
2 <html>
3 <body>
4 <div style="width: 1000px; height: 1000px; position: absolute; top: 0; left: 0;"></div>
5 <div style="width: 100px; height: 100px; position: absolute; top: 100px; left: 0; background: green"></div>
6 <p>
7 Test for <i><a href="rdar://problem/6643103">rdar://problem/6643103</a>
8 Unscaled values from body.scrollHeight</i>.
9 </p>
10 <script src="../../resources/js-test.js"></script>
11 <script>
12 var floatPrecision = 0.00001;
13 function checkValue(actual, expected)
15 if (window.eventSender) {
16 shouldBeCloseTo(actual, expected, floatPrecision);
20 if (window.testRunner) {
21 testRunner.dumpAsText();
22 checkValue('document.scrollingElement.scrollHeight', 1000)
23 checkValue('document.scrollingElement.scrollWidth', 1000);
25 // Scrolling right to 50.
26 document.scrollingElement.scrollLeft = 50;
27 checkValue('document.scrollingElement.scrollLeft', 50);
29 // Zooming in.
30 eventSender.zoomPageIn();
31 checkValue('document.scrollingElement.scrollHeight', 1000);
32 checkValue('document.scrollingElement.scrollWidth', 1000);
33 checkValue('document.scrollingElement.scrollTop', 0);
34 checkValue('document.scrollingElement.scrollLeft', 50);
36 // Scrolling down to 100.
37 document.scrollingElement.scrollTop = 100;
38 checkValue('document.scrollingElement.scrollTop', 100);
40 // Zooming back out.
41 eventSender.zoomPageOut();
42 checkValue('document.scrollingElement.scrollTop', 100);
43 checkValue('document.scrollingElement.scrollLeft', 50);
45 </script>
46 </body>
47 </html>