1
0
Fork 0
firefox/testing/web-platform/tests/css/css-scroll-snap/multicol-001.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

27 lines
1.2 KiB
HTML

<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
<link rel="help" href="https://drafts.csswg.org/css-scroll-snap-1/#overview">
<link rel="help" href="https://drafts.csswg.org/css-multicol/">
<meta name="assert" content="Scroll snapping on fragmented block inside multicol">
<div id="scrollable" style="overflow:hidden; margin:100px; scroll-snap-type:x mandatory; columns:3; width:340px; column-gap:20px; column-fill:auto; height:100px;">
<div style="height:200px; background:blue;"></div>
<div id="target" style="scroll-snap-align:start; height:120px; background:cyan;"></div>
<div style="height:200px; background:gray;"></div>
</div>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(()=> {
assert_equals(scrollable.scrollLeft, 240);
}, "scroll-snap-align: start");
test(()=> {
target.style.scrollSnapAlign = "end";
assert_equals(scrollable.scrollLeft, 120);
}, "scroll-snap-align: end");
test(()=> {
target.style.scrollSnapAlign = "center";
assert_equals(scrollable.scrollLeft, 180);
}, "scroll-snap-align: center");
</script>