Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / scrolling / fractional-scroll-offset-document.html
blobdd4090cdf6b9564b6fce456033561f5840035cc1
1 <!DOCTYPE HTML>
2 <body style="width:30000px;height:30000px" onload="runTest()">
3 </body>
5 <script src="../../resources/js-test.js"></script>
6 <script>
7 description("Verifies that document scrolling supports fractional offset.");
9 var floatPrecision = 0.00001;
10 var useIntegerScrollOffset = false;
11 function checkScrollOffset(offset_x, offset_y)
13 if (useIntegerScrollOffset) {
14 offset_x = Math.floor(offset_x);
15 offset_y = Math.floor(offset_y);
17 shouldBeCloseTo('document.scrollingElement.scrollTop', offset_y, floatPrecision);
18 shouldBeCloseTo('document.scrollingElement.scrollLeft', offset_x, floatPrecision);
21 function scroll()
23 window.scrollTo(0, 0);
24 eventSender.gestureScrollBegin(100.1, 300.2);
25 checkScrollOffset(0, 0);
26 eventSender.gestureScrollUpdate(-20.5, -10.2);
27 checkScrollOffset(20.5, 10.2);
28 eventSender.gestureScrollUpdate(10.9, -20.9);
29 checkScrollOffset(9.6, 31.1);
30 eventSender.gestureScrollUpdate(100.4, 220.9);
31 checkScrollOffset(0.0, 0.0);
32 eventSender.gestureScrollEnd(0, 0);
35 function runTest()
37 if (window.eventSender) {
38 debug("set PreferCompositingToLCDTextEnabled true");
39 window.internals.settings.setPreferCompositingToLCDTextEnabled(true);
40 scroll();
42 debug("set PreferCompositingToLCDTextEnabled false");
43 window.internals.settings.setPreferCompositingToLCDTextEnabled(false);
44 useIntegerScrollOffset = true;
45 scroll();
49 </script>
50 </html>