Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / accessibility / scroll-containers.html
blob40c3066a93645ef37e30378edc555e452e8b9010
1 <!DOCTYPE HTML>
2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script>
5 <div id="container">
6 <div style="border: 1px solid #000; height: 5000px;">5000-pixel box</div>
8 <div id="outer" style="height: 100px; overflow: scroll">
9 <div style="border: 1px solid #000; height: 5000px;">5000-pixel box</div>
10 <div id="inner" style="height: 100px; overflow: scroll">
11 <div style="border: 1px solid #000; height: 5000px;">5000-pixel box</div>
12 <button id="target">Target</button>
13 </div>
14 </div>
15 </div>
17 <div id="console"></div>
19 <script>
20 test(function(t) {
21 var axWebArea = accessibilityController.rootElement;
22 assert_equals(axWebArea.role, "AXRole: AXWebArea");
24 assert_true(axWebArea.isScrollableContainer);
25 assert_equals(axWebArea.scrollOffsetY, 0);
26 assert_not_equals(axWebArea.maxScrollOffsetY, 0);
27 axWebArea.setScrollOffset(0, axWebArea.maxScrollOffsetY);
28 assert_equals(axWebArea.scrollOffsetY, axWebArea.maxScrollOffsetY);
30 var axOuter = accessibilityController.accessibleElementById("outer");
31 assert_true(axOuter.isScrollableContainer);
32 assert_equals(axOuter.scrollOffsetY, 0);
33 assert_not_equals(axOuter.maxScrollOffsetY, 0);
34 axOuter.setScrollOffset(0, axOuter.maxScrollOffsetY);
35 assert_equals(axOuter.scrollOffsetY, axOuter.maxScrollOffsetY);
37 var axInner = accessibilityController.accessibleElementById("inner");
38 assert_true(axInner.isScrollableContainer);
39 assert_equals(axInner.scrollOffsetY, 0);
40 assert_not_equals(axInner.maxScrollOffsetY, 0);
41 axInner.setScrollOffset(0, axInner.maxScrollOffsetY);
42 assert_equals(axInner.scrollOffsetY, axInner.maxScrollOffsetY);
44 var axTarget = accessibilityController.accessibleElementById("target");
45 assert_false(axTarget.isScrollableContainer);
46 }, "Test scroll container APIs.");
48 if (window.testRunner)
49 document.getElementById("container").style.display = "none";
50 </script>