summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/scrolling/html-element-client-rect-excludes-scrollbars.html
blob: 01339636fba850a60fb5581a66a83c49206baa32 (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
<!DOCTYPE html>
<script src="../../resources/js-test.js"></script>
<style>
::-webkit-scrollbar {
  width: 20px;
  height: 20px;
}
#space {
  height: 1000px;
  width: 1000px;
}
</style>
<div id="space"></div>
<script>

description(
    "Tests that the html element excludes scrollbars when reporting " +
    "clientWidth and clientHeight, and that it implements scroll() " +
    "by scrolling the frame.");

var htmlElement = document.documentElement;
shouldBe("htmlElement.clientWidth", "innerWidth - 20");
shouldBe("htmlElement.clientHeight", "innerHeight - 20");

htmlElement.scroll(10, 10);
shouldBe("scrollX", "10");
shouldBe("scrollY", "10");

</script>