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 |