summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-scroll-snap/overscroll-snap.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/css/css-scroll-snap/overscroll-snap.html
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/css-scroll-snap/overscroll-snap.html')
-rw-r--r--testing/web-platform/tests/css/css-scroll-snap/overscroll-snap.html50
1 files changed, 50 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-scroll-snap/overscroll-snap.html b/testing/web-platform/tests/css/css-scroll-snap/overscroll-snap.html
new file mode 100644
index 0000000000..13437492ca
--- /dev/null
+++ b/testing/web-platform/tests/css/css-scroll-snap/overscroll-snap.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <link rel="help" href="https://drafts.csswg.org/css-scroll-snap-1/#scroll-snap-type" />
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/resources/testdriver.js"></script>
+ <script src="/resources/testdriver-actions.js"></script>
+ <script src="/resources/testdriver-vendor.js"></script>
+ <script src="/dom/events/scrolling/scroll_support.js"></script>
+ </head>
+ <body>
+ <style>
+ #scroller {
+ width: 200px;
+ height: 400px;
+ overflow-y: scroll;
+ scroll-snap-type: y mandatory;
+ background-color: blue;
+ }
+ #snap_target {
+ width: 100px;
+ height: 1942.5px;
+ scroll-snap-align: start;
+ background-color: pink;
+ }
+ </style>
+ <div id="scroller">
+ <div id="snap_target"></div>
+ </div>
+ <script>
+ promise_test(async (t) => {
+ await waitForCompositorCommit();
+ let scrollend_promise = new Promise((resolve) => {
+ scroller.addEventListener("scrollend", resolve);
+ });
+ let scroll_promise = new Promise((resolve) => {
+ scroller.addEventListener("scroll", resolve);
+ });
+ await new test_driver.Actions().scroll(0, 0, 0,
+ scroller.scrollHeight, { origin: scroller }).send();
+ await scroll_promise;
+ await scrollend_promise;
+ assert_approx_equals(scroller.scrollTop,
+ scroller.scrollHeight - scroller.clientHeight, 1,
+ "scroller is scrolled to its bottom and not its top.");
+ }, "snapport covered by snap area doesn't jump");
+ </script>
+ </body>
+</html>