4 <script src=
"../../resources/js-test.js"></script>
7 var pixelsPerWheelTick
= 40;
10 eventSender
.mouseMoveTo(div
.offsetLeft
+ 5, div
.offsetTop
+ 5);
11 eventSender
.mouseScrollBy(0,-1);
12 eventSender
.mouseScrollBy(-1,0);
15 function checkOffsets() {
16 div
= document
.getElementById("overflow-1");
17 debug("===overflow:scroll with overflow");
18 shouldBe('div.scrollTop', 'window.pixelsPerWheelTick');
19 shouldBe('div.scrollLeft', 'window.pixelsPerWheelTick');
21 div
= document
.getElementById("overflow-2");
22 debug("===overflow:auto with overflow");
23 shouldBe('div.scrollTop', 'window.pixelsPerWheelTick');
24 shouldBe('div.scrollLeft', 'window.pixelsPerWheelTick');
26 div
= document
.getElementById("overflow-3");
27 debug("===overflow:hidden with overflow");
28 shouldBe('div.scrollTop', '0');
29 shouldBe('div.scrollLeft', '0');
31 div
= document
.getElementById("overflow-4");
32 debug("===overflow:overlay with overflow");
33 shouldBe('div.scrollTop', 'window.pixelsPerWheelTick');
34 shouldBe('div.scrollLeft', 'window.pixelsPerWheelTick');
36 div
= document
.getElementById("no-overflow-1");
37 debug("===overflow:scroll without overflow");
38 shouldBe('div.scrollTop', '0');
39 shouldBe('div.scrollLeft', '0');
41 div
= document
.getElementById("no-overflow-2");
42 debug("===overflow:auto without overflow");
43 shouldBe('div.scrollTop', '0');
44 shouldBe('div.scrollLeft', '0');
46 div
= document
.getElementById("no-overflow-3");
47 debug("===overflow:hidden without overflow");
48 shouldBe('div.scrollTop', '0');
49 shouldBe('div.scrollLeft', '0');
51 div
= document
.getElementById("no-overflow-4");
52 debug("===overflow:overlay without overflow");
53 shouldBe('div.scrollTop', '0');
54 shouldBe('div.scrollLeft', '0');
56 testRunner
.notifyDone();
60 if (window
.eventSender
&& window
.testRunner
) {
61 testRunner
.waitUntilDone();
63 description('This tests that scrollable areas with the appropriate overflow mode set'
64 + ' are in fact scrollable by the user.');
66 div
= document
.getElementById("overflow-1");
68 div
= document
.getElementById("overflow-2");
70 div
= document
.getElementById("overflow-3");
72 div
= document
.getElementById("overflow-4");
74 div
= document
.getElementById("no-overflow-1");
76 div
= document
.getElementById("no-overflow-2");
78 div
= document
.getElementById("no-overflow-3");
80 div
= document
.getElementById("no-overflow-4");
83 setTimeout('checkOffsets();', 100);
85 debug("FAIL: This test requires window.eventSender.");
91 <body style=
"margin: 0" onload=
"test()">
93 <div id=
"overflow-1" style=
"width: 100px; height: 100px; overflow-x: scroll; overflow-y: scroll">
94 <div style=
"width: 200px; height: 200px;">Content
</div>
97 <div id=
"overflow-2" style=
"width: 100px; height: 100px; overflow-x: auto; overflow-y: auto">
98 <div style=
"width: 200px; height: 200px;">Content
</div>
101 <div id=
"overflow-3" style=
"width: 100px; height: 100px; overflow-x: hidden; overflow-y: hidden">
102 <div style=
"width: 200px; height: 200px;">Content
</div>
104 overlay with overflow
105 <div id=
"overflow-4" style=
"width: 100px; height: 100px; overflow-x: overlay; overflow-y: overlay">
106 <div style=
"width: 200px; height: 200px;">Content
</div>
109 scroll without overflow
110 <div id=
"no-overflow-1" style=
"width: 100px; height: 100px; overflow-x: scroll; overflow-y: scroll">
111 <div style=
"width: 20px; height: 20px;">Content
</div>
113 auto without overflow
114 <div id=
"no-overflow-2" style=
"width: 100px; height: 100px; overflow-x: auto; overflow-y: auto">
115 <div style=
"width: 20px; height: 20px;">Content
</div>
117 hidden without overflow
118 <div id=
"no-overflow-3" style=
"width: 100px; height: 100px; overflow-x: hidden; overflow-y: hidden">
119 <div style=
"width: 20px; height: 20px;">Content
</div>
121 overlay without overflow
122 <div id=
"no-overflow-4" style=
"width: 100px; height: 100px; overflow-x: overlay; overflow-y: overlay">
123 <div style=
"width: 20px; height: 20px;">Content
</div>