Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / Element / getBoundingClientRect-getClientRects-relative-to-viewport.html
blob278f700b62aeaf427730f8aa2e69a36d9e51eed2
1 <script src="../../../resources/js-test.js"></script>
2 <style>
3 #pusher {
4 width: 1000px;
5 height: 1000px;
6 outline: 1px solid black;
8 </style>
9 <div id="console"></div>
10 <div id="testArea">
11 <br>
12 <p id="test">Test content</p>
13 <div id="pusher">This box is here to create scrollbars.</div>
14 </div>
15 <script>
16 if (window.testRunner)
17 testRunner.dumpAsText();
19 var element = document.getElementById('test');
21 // Get base numbers
22 var unScrolledBoundingBox = element.getBoundingClientRect();
23 var unScrolledBoundingBoxes = element.getClientRects();
25 // Test scrolling down
26 window.scrollBy(0, 50);
27 var scrolledDownBoundingBox = element.getBoundingClientRect();
28 var scrolledDownBoundingBoxes = element.getClientRects();
30 // Reset
31 window.scrollTo(0, 0);
33 // Test scrolling right
34 window.scrollBy(50, 0);
35 var scrolledRightBoundingBox = element.getBoundingClientRect();
36 var scrolledRightBoundingBoxes = element.getClientRects();
38 // Reset
39 window.scrollTo(0, 0);
41 shouldBe("unScrolledBoundingBox.top - scrolledDownBoundingBox.top", "50");
42 shouldBe("unScrolledBoundingBoxes[0].top - scrolledDownBoundingBoxes[0].top", "50");
43 shouldBe("unScrolledBoundingBox.left - scrolledRightBoundingBox.left", "50");
44 shouldBe("unScrolledBoundingBoxes[0].left - scrolledRightBoundingBoxes[0].left", "50");
46 if (window.testRunner) {
47 var area = document.getElementById('testArea');
48 area.parentNode.removeChild(area);
50 </script>