summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/scrolling/scroll-clears-fragment-anchor.html
blob: 8853400ab4854891d503fe50fbd4ddc4cde4c376 (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
31
32
33
34
35
<!DOCTYPE html>
<script src="../../resources/js-test.js"></script>
<style>

body {
    height: 1000px;
}
#a1 {
    display: block;
    position: absolute;
    width: 1px;
    height: 1px;
    left: 0;
    top: 0;
}

</style>
<a id="a1" name="a1"></a>
<script>

description("Tests that after an explicit scroll, we do not continue to " +
    "maintain scroll position at the anchor identified by the hash fragment.");

location.hash = "a1";

// This scroll should reset FrameView::m_fragmentAnchor.
scrollTo(0, 10);

// Force a layout.
document.querySelector("#a1").style.width = "2px";

shouldBe(String(scrollY), "10");
location.hash = "";

</script>