Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/browsers/browsing-the-web/scroll-to-fragid/scroll-position-inline-nearest.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html style="writing-mode: vertical-lr;">
<head>
<meta charset="UTF-8">
<title>Fragment Navigation: inline start position should not scroll out of content range</title>
<link rel="author" href="mailto:mrobinson@igalia.com" title="Martin Robinson">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<!-- When scrolling to this fragment the viewport inline position should not
change because, it is already fully enclosed by the viewport and page width. -->
<div id="test1" style="position: absolute; top: 5000px; left: 100px; height: 100px; width: 100px;"></div>
<script>
var t = async_test("ScrollToFragment");
t.step(() => {
location.hash = "test1";
setTimeout(t.step_func(() => {
assert_true(window.scrollY > 0);
assert_true(window.scrollY < 5000);
assert_equals(window.scrollX, 0);
t.done();
}));
});
</script>
</body>
</html>