Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Unified Diff: LayoutTests/accessibility/scroll-containers.html

Issue 1121473004: Expose scroll containers via accessibility APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/TestExpectations ('k') | Source/modules/accessibility/AXLayoutObject.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/accessibility/scroll-containers.html
diff --git a/LayoutTests/accessibility/scroll-containers.html b/LayoutTests/accessibility/scroll-containers.html
new file mode 100644
index 0000000000000000000000000000000000000000..40c3066a93645ef37e30378edc555e452e8b9010
--- /dev/null
+++ b/LayoutTests/accessibility/scroll-containers.html
@@ -0,0 +1,50 @@
+<!DOCTYPE HTML>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+
+<div id="container">
+ <div style="border: 1px solid #000; height: 5000px;">5000-pixel box</div>
+
+ <div id="outer" style="height: 100px; overflow: scroll">
+ <div style="border: 1px solid #000; height: 5000px;">5000-pixel box</div>
+ <div id="inner" style="height: 100px; overflow: scroll">
+ <div style="border: 1px solid #000; height: 5000px;">5000-pixel box</div>
+ <button id="target">Target</button>
+ </div>
+ </div>
+</div>
+
+<div id="console"></div>
+
+<script>
+test(function(t) {
+ var axWebArea = accessibilityController.rootElement;
+ assert_equals(axWebArea.role, "AXRole: AXWebArea");
+
+ assert_true(axWebArea.isScrollableContainer);
+ assert_equals(axWebArea.scrollOffsetY, 0);
+ assert_not_equals(axWebArea.maxScrollOffsetY, 0);
+ axWebArea.setScrollOffset(0, axWebArea.maxScrollOffsetY);
+ assert_equals(axWebArea.scrollOffsetY, axWebArea.maxScrollOffsetY);
+
+ var axOuter = accessibilityController.accessibleElementById("outer");
+ assert_true(axOuter.isScrollableContainer);
+ assert_equals(axOuter.scrollOffsetY, 0);
+ assert_not_equals(axOuter.maxScrollOffsetY, 0);
+ axOuter.setScrollOffset(0, axOuter.maxScrollOffsetY);
+ assert_equals(axOuter.scrollOffsetY, axOuter.maxScrollOffsetY);
+
+ var axInner = accessibilityController.accessibleElementById("inner");
+ assert_true(axInner.isScrollableContainer);
+ assert_equals(axInner.scrollOffsetY, 0);
+ assert_not_equals(axInner.maxScrollOffsetY, 0);
+ axInner.setScrollOffset(0, axInner.maxScrollOffsetY);
+ assert_equals(axInner.scrollOffsetY, axInner.maxScrollOffsetY);
+
+ var axTarget = accessibilityController.accessibleElementById("target");
+ assert_false(axTarget.isScrollableContainer);
+}, "Test scroll container APIs.");
+
+if (window.testRunner)
+ document.getElementById("container").style.display = "none";
+</script>
« no previous file with comments | « LayoutTests/TestExpectations ('k') | Source/modules/accessibility/AXLayoutObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698