summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/scrolling/fixed-position-behind-scrollbar.html
blob: a6c3a2203d610da09ae62ddc84a01c718871ab8d (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>
#f {
  position: fixed;
  background-color: #def;
  width: 600px;
  height: 400px;
  right: -20px;
  bottom: -20px;
}
body {
  width: 1000px;
  height: 1000px;
}
</style>
Tests that the scrollbar can be clicked even when it clips a position:fixed
element, and that the scrollbars are excluded from the viewport for determining
the element's position.
<div id="f"></div>
<script>
window.jsTestIsAsync = true;

function finishTest() {
  var rect = document.querySelector("#f").getBoundingClientRect();
  shouldBe(rect.left + "," + rect.top, "205,205");
  finishJSTest();
}

function runTest() {
  eventSender.mouseMoveTo(790, 500);
  eventSender.mouseDown();
  eventSender.mouseUp();
  shouldBecomeEqual('scrollY > 0', 'true', finishTest);
}

onload = runTest;

</script>