summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position-inline-nearest.html
blob: 4aab0aa5e5a1e4a3eea82282be2344586a9a6d02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!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="help" href="https://html.spec.whatwg.org/multipage/#scroll-to-the-fragment-identifier">
<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>