Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / scrollbars / scroll-rtl-or-bt-layer.html
blob8d4b39bc4e9f56c2b7bd059c10be5f478c931cd0
1 <html>
2 <body>
4 <p>This test requires DumpRenderTree. To test manually, try to scroll the
5 blue div to the left and the red div up using the scrollbar arrows or the
6 mouse wheel. The test passes if the divs scroll.</p>
8 <div id='rtl' style="direction: rtl; width: 100px; overflow: auto; border: 1px solid blue;">
9 01234567890123456789
10 </div>
12 <div id='bt' style="-webkit-writing-mode: horizontal-bt; height: 100px; overflow: auto; border: 1 px solid red;">
13 aaa<br>
14 bbb<br>
15 ccc<br>
16 ddd<br>
17 eee<br>
18 fff<br>
19 ggg<br>
20 hhh<br>
21 iii<br>
22 jjj<br>
23 kkk
24 </div>
26 <div id="console"></div>
28 <script>
29 function log(message)
31 document.getElementById("console").innerHTML += message + "<br>";
34 function centerMouseOn(elementId)
36 var element = document.getElementById(elementId);
37 eventSender.mouseMoveTo(element.offsetLeft + element.offsetWidth / 2,
38 element.offsetTop + element.offsetHeight / 2);
41 function test()
43 if (window.testRunner)
44 testRunner.dumpAsText();
46 if (!window.eventSender || !window.eventSender.mouseScrollBy) {
47 log("This test requires DumpRenderTree with eventSender.mouseScrollBy.");
48 return;
51 centerMouseOn("rtl");
52 var offsetBefore = document.getElementById("rtl").scrollLeft;
53 eventSender.mouseScrollBy(1, 0);
54 var offsetAfter = document.getElementById("rtl").scrollLeft;
55 if (offsetBefore > offsetAfter)
56 log("rtl: PASS");
57 else {
58 log("rtl: FAIL");
59 log("scrollLeft before: " + offsetBefore);
60 log("scrollLeft after: " + offsetAfter);
63 centerMouseOn("bt");
64 offsetBefore = document.getElementById("bt").scrollTop;
65 eventSender.mouseScrollBy(0, 1);
66 offsetAfter = document.getElementById("bt").scrollTop;
67 if (offsetBefore > offsetAfter)
68 log("bt: PASS");
69 else {
70 log("bt: FAIL");
71 log("scrollTop before: " + offsetBefore);
72 log("scrollTop after: " + offsetAfter);
75 document.body.removeChild(document.getElementById("rtl"));
76 document.body.removeChild(document.getElementById("bt"));
79 test();
80 </script>
82 </body>
83 </html>