Allow 2 observed scroll events to make sure scroll snapping doesn't snap to the snap destination instantly.
I guess Chrome's implementation scrolls the given scroll position of the scroll
operation once then snaps to the snap destination, thus there are 3 or more
scroll events. But Firefox scrolls to the snap destination from the beginning.
Differential Revision: https://phabricator.services.mozilla.com/D183073
bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1785551
gecko-commit: 47c72d2828f6f406fbe77758e1ae8cd7837af977
gecko-reviewers: botond
diff --git a/css/css-scroll-snap/input/keyboard.html b/css/css-scroll-snap/input/keyboard.html
index 86e6143..10796f2 100644
--- a/css/css-scroll-snap/input/keyboard.html
+++ b/css/css-scroll-snap/input/keyboard.html
@@ -51,7 +51,7 @@
await waitForScrollEnd(scroller);
assert_equals(scroller.scrollTop, 400);
// Make sure we don't jump directly to the new snap position.
- assert_greater_than(scrollCounter.count, 2);
+ assert_greater_than(scrollCounter.count, 1);
}, "Snaps to bottom-left after pressing ArrowDown");
promise_test(async t => {
@@ -62,7 +62,7 @@
await waitForScrollEnd(scroller);
assert_equals(scroller.scrollTop, 0);
// Make sure we don't jump directly to the new snap position.
- assert_greater_than(scrollCounter.count, 2);
+ assert_greater_than(scrollCounter.count, 1);
}, "Snaps to top-left after pressing ArrowUp");
promise_test(async t => {
@@ -73,7 +73,7 @@
await waitForScrollEnd(scroller);
assert_equals(scroller.scrollLeft, 400);
// Make sure we don't jump directly to the new snap position.
- assert_greater_than(scrollCounter.count, 2);
+ assert_greater_than(scrollCounter.count, 1);
}, "Snaps to top-right after pressing ArrowRight");
promise_test(async t => {
@@ -84,7 +84,7 @@
await waitForScrollEnd(scroller);
assert_equals(scroller.scrollLeft, 0);
// Make sure we don't jump directly to the new snap position.
- assert_greater_than(scrollCounter.count, 2);
+ assert_greater_than(scrollCounter.count, 1);
}, "Snaps to top-left after pressing ArrowLeft");
promise_test(async t => {