diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/css/css-scroll-snap/unreachable-snap-positions-002.html | |
parent | Initial commit. (diff) | |
download | firefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/css-scroll-snap/unreachable-snap-positions-002.html')
-rw-r--r-- | testing/web-platform/tests/css/css-scroll-snap/unreachable-snap-positions-002.html | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-scroll-snap/unreachable-snap-positions-002.html b/testing/web-platform/tests/css/css-scroll-snap/unreachable-snap-positions-002.html new file mode 100644 index 0000000000..a3726d71b3 --- /dev/null +++ b/testing/web-platform/tests/css/css-scroll-snap/unreachable-snap-positions-002.html @@ -0,0 +1,67 @@ +<!DOCTYPE html> +<meta name="viewport" content="width=device-width, initial-scale=1"> +<link rel="help" href="https://drafts.csswg.org/css-scroll-snap/#unreachable" /> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<style> +.scroller { + width: 100vw; + height: 100px; + display: flex; + scroll-snap-type: x mandatory; + overflow-x: auto; +} +.scroller.rtl { + direction: rtl; +} +.scroller.end > span { + scroll-snap-align: end; +} +.scroller.center > span { + scroll-snap-align: end; +} +</style> +<div class="scroller end"> + <span style="min-width: 25px;"></span> + <span style="min-width: 100vw;"></span> +</div> +<div class="scroller center"> + <span style="min-width: 25px;"></span> + <span style="min-width: 100vw;"></span> +</div> +<div class="scroller end rtl"> + <span style="min-width: 25px;"></span> + <span style="min-width: 100vw;"></span> +</div> +<div class="scroller center rtl"> + <span style="min-width: 25px;"></span> + <span style="min-width: 100vw;"></span> +</div> +<script> + +test(() => { + const scroller = document.querySelector(".scroller.end"); + assert_equals(scroller.scrollLeft, 0); + assert_equals(scroller.scrollTop, 0); +}, "Unreachable snap point with `scroll-snap-align: end`"); + +test(() => { + const scroller = document.querySelector(".scroller.center"); + assert_equals(scroller.scrollLeft, 0); + assert_equals(scroller.scrollTop, 0); +}, "Unreachable snap point with `scroll-snap-align: center`"); + +test(() => { + const scroller = document.querySelector(".scroller.end.rtl"); + assert_equals(scroller.scrollLeft, 0); + assert_equals(scroller.scrollTop, 0); +}, "Unreachable snap point with `scroll-snap-align: end` in RTL"); + +test(() => { + const scroller = document.querySelector(".scroller.center.rtl"); + assert_equals(scroller.scrollLeft, 0); + assert_equals(scroller.scrollTop, 0); +}, "Unreachable snap point with `scroll-snap-align: center` in RTL"); + +</script> +</html> |