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

Unified Diff: Source/modules/accessibility/AXRenderObject.cpp

Issue 730113003: Introduce new API orientation() to expose aria-orientation correctly. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: updating condition for TreeGridRole Created 6 years, 1 month 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
Index: Source/modules/accessibility/AXRenderObject.cpp
diff --git a/Source/modules/accessibility/AXRenderObject.cpp b/Source/modules/accessibility/AXRenderObject.cpp
index 57c1c1b6fcc53b6c43c7c08f8147f0c9ae43a694..965ed185cee6518a3f9cc8ec5568f09a7a1f64f0 100644
--- a/Source/modules/accessibility/AXRenderObject.cpp
+++ b/Source/modules/accessibility/AXRenderObject.cpp
@@ -845,15 +845,44 @@ const AtomicString& AXRenderObject::accessKey() const
AccessibilityOrientation AXRenderObject::orientation() const
{
const AtomicString& ariaOrientation = getAttribute(aria_orientationAttr);
- if (equalIgnoringCase(ariaOrientation, "horizontal"))
- return AccessibilityOrientationHorizontal;
- if (equalIgnoringCase(ariaOrientation, "vertical"))
- return AccessibilityOrientationVertical;
+ AccessibilityOrientation axorientation = AccessibilityOrientationUndefined;
+
+ // For TreeGridRole, roleValue() can't be compared because its overridden
+ // in AXTable::roleValue()
+ if (ariaRoleAttribute() == TreeGridRole) {
+ if (equalIgnoringCase(ariaOrientation, "horizontal"))
+ axorientation = AccessibilityOrientationHorizontal;
+ if (equalIgnoringCase(ariaOrientation, "vertical"))
+ axorientation = AccessibilityOrientationVertical;
+ return axorientation;
+ }
- if (isScrollbar())
- return AccessibilityOrientationVertical;
+ switch (roleValue()) {
+ case ComboBoxRole:
+ case ListBoxRole:
+ case MenuRole:
+ case ScrollBarRole:
+ case TreeRole:
+ axorientation = AccessibilityOrientationVertical;
+ break;
+ case MenuBarRole:
+ case SliderRole:
+ case SplitterRole:
+ case TabListRole:
+ case ToolbarRole:
+ axorientation = AccessibilityOrientationHorizontal;
+ break;
+ case RadioGroupRole:
+ break;
+ default:
+ return AXObject::orientation();
+ }
- return AXObject::orientation();
+ if (equalIgnoringCase(ariaOrientation, "horizontal"))
+ axorientation = AccessibilityOrientationHorizontal;
+ if (equalIgnoringCase(ariaOrientation, "vertical"))
+ axorientation = AccessibilityOrientationVertical;
+ return axorientation;
}
String AXRenderObject::text() const

Powered by Google App Engine
This is Rietveld 408576698