Index: LayoutTests/fast/scrolling/fractional-scroll-offset-document.html |
diff --git a/LayoutTests/fast/scrolling/fractional-scroll-offset-document.html b/LayoutTests/fast/scrolling/fractional-scroll-offset-document.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..33fcd80a1c2ce9a303b2d88cae4e94542d14178e |
--- /dev/null |
+++ b/LayoutTests/fast/scrolling/fractional-scroll-offset-document.html |
@@ -0,0 +1,43 @@ |
+<!DOCTYPE HTML> |
+<html> |
Rick Byers
2014/10/04 00:04:24
nit: omit <html> tag
Yufeng Shen (Slow to review)
2014/10/06 17:54:58
Done.
|
+<body style="width:30000px;height:30000px" onload="runTest()"> |
+</body> |
+ |
+<script src="../../resources/js-test.js"></script> |
+<script> |
+description("Verifies that document scrolling supports fractional offset."); |
+ |
+var floatPrecision = 0.00001; |
+function checkScrollOffset(offset_x, offset_y) |
+{ |
+ if (window.eventSender) { |
Rick Byers
2014/10/04 00:04:24
nit: remove this check. We'll never hit this func
Yufeng Shen (Slow to review)
2014/10/06 17:54:57
Done.
|
+ shouldBeCloseTo('document.documentElement.scrollTop', offset_y, floatPrecision); |
+ shouldBeCloseTo('document.documentElement.scrollLeft', offset_x, floatPrecision); |
+ } |
+} |
+ |
+function scroll() |
+{ |
+ eventSender.gestureScrollBegin(100.1, 300.2); |
+ checkScrollOffset(0, 0); |
+ eventSender.gestureScrollUpdate(-20.5, -10.2); |
+ checkScrollOffset(20.5, 10.2); |
+ eventSender.gestureScrollUpdate(10.9, -20.9); |
+ checkScrollOffset(9.6, 31.1); |
+ eventSender.gestureScrollUpdate(100.4, 220.9); |
+ checkScrollOffset(0.0, 0.0); |
+ eventSender.gestureScrollEnd(0, 0); |
+ |
+ isSuccessfullyParsed(); |
+ if (window.testRunner) |
+ testRunner.notifyDone(); |
Rick Byers
2014/10/04 00:04:24
You should be able to remove these three lines. T
Yufeng Shen (Slow to review)
2014/10/06 17:54:57
Done.
Rick Byers
2014/10/06 21:11:30
remove isSuccessfullyParsed too - that should be r
|
+} |
+ |
+function runTest() |
+{ |
+ if (window.eventSender) |
+ scroll(); |
+} |
+ |
+</script> |
+</html> |