summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/scrolling/fixed-position-scroll-into-view.html
blob: 2c26180dfddce484a701570f87a936a3d2f0cf7c (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
36
37
38
39
<!DOCTYPE html>
<script src="../../resources/js-test.js"></script>
<style>
.target {
  position: fixed;
  top: 100px;
  left: 100px;
  width: 100px;
  height: 50px;
  background-color: #ccc;
}
</style>
<div style="height: 1000px"></div>
<div class="target" id="t1"></div>
<div style="position: absolute; top: 100px; transform: translateZ(0)">
  <div class="target" id="t2"></div>
</div>
<script>
</script>

<script>

description("Tests that scrolling to a fixed position element does not scroll the viewport.");

location.hash = "#t1";
shouldBe("scrollY", "0");

location.hash = "#t2";
shouldBe("scrollY", "200");

location.hash = "#t1";
shouldBe("scrollY", "200");

location.hash = "#";
shouldBe("scrollY", "0");

</script>
</body>
<html>