1
0
Fork 0
firefox/testing/web-platform/tests/css/css-scroll-snap/scroll-start/scroll-start-with-fragment-navigation.tentative.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

30 lines
No EOL
1.1 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title> CSS Scroll Snap 2 Test: scroll-start interaction with fragment-navigation</title>
<link rel="help" href="https://drafts.csswg.org/css-scroll-snap-2/#scroll-start">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<iframe id="frame" src="scroll-start-with-fragment-navigation-inner-frame.html#fragment_target"
onload="runTest()"></iframe>
<script>
function runTest() {
test((t) => {
let scroller = frame.contentDocument.scrollingElement;
// fragment_target is at the bottom of the frame so the frame should be
// fully scrolled down to bring it into view.
let expected_scroll_top = scroller.scrollHeight - scroller.clientHeight;
assert_equals(frame.contentWindow.location.hash, "#fragment_target");
assert_not_equals(100, expected_scroll_top);
assert_equals(frame.contentDocument.scrollingElement.scrollTop,
expected_scroll_top);
}, "scroll-start does not override hash fragment navigation");
}
</script>
</body>