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

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: incorporating comments 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
« no previous file with comments | « Source/modules/accessibility/AXObject.cpp ('k') | Source/modules/accessibility/AXScrollView.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/accessibility/AXRenderObject.cpp
diff --git a/Source/modules/accessibility/AXRenderObject.cpp b/Source/modules/accessibility/AXRenderObject.cpp
index aaccaacbfc23aac6aa405be6ee28755266f7de4e..ca3077ec993db8602a6282c468681e9b5ac1eece 100644
--- a/Source/modules/accessibility/AXRenderObject.cpp
+++ b/Source/modules/accessibility/AXRenderObject.cpp
@@ -848,15 +848,35 @@ 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;
- 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:
+ case TreeGridRole:
shreeramk 2014/11/21 11:07:47 Here, TreeGridRole case is not true. Reason: role
dmazzoni 2014/11/24 17:36:59 The logic sounds great. To make the code more rea
shreeramk 2014/11/25 08:58:37 Added code for TreeGridRole.
+ 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
« no previous file with comments | « Source/modules/accessibility/AXObject.cpp ('k') | Source/modules/accessibility/AXScrollView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698