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

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

Issue 1346733002: Added layout test for aria-orientation and cleaned up code. Also exposed hr element with an orienta… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added TableRole back with a TODO to fix the relevant bug. Created 5 years, 3 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 | « Source/modules/accessibility/AXNodeObject.h ('k') | Source/modules/accessibility/AXObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/accessibility/AXNodeObject.cpp
diff --git a/Source/modules/accessibility/AXNodeObject.cpp b/Source/modules/accessibility/AXNodeObject.cpp
index 2accbbfa87d80306397c5198e6c3eed26f529f5d..f0f73a6732a0d43f379621a9b40814a930bf4498 100644
--- a/Source/modules/accessibility/AXNodeObject.cpp
+++ b/Source/modules/accessibility/AXNodeObject.cpp
@@ -500,6 +500,9 @@ AccessibilityRole AXNodeObject::determineAccessibilityRoleUtil()
if (isEmbeddedObject())
return EmbeddedObjectRole;
+ if (isHTMLHRElement(*node()))
+ return SplitterRole;
+
return UnknownRole;
}
@@ -1255,6 +1258,44 @@ String AXNodeObject::deprecatedPlaceholder() const
return placeholder;
}
+AccessibilityOrientation AXNodeObject::orientation() const
+{
+ const AtomicString& ariaOrientation = getAttribute(aria_orientationAttr);
+ AccessibilityOrientation orientation = AccessibilityOrientationUndefined;
+ if (equalIgnoringCase(ariaOrientation, "horizontal"))
+ orientation = AccessibilityOrientationHorizontal;
+ else if (equalIgnoringCase(ariaOrientation, "vertical"))
+ orientation = AccessibilityOrientationVertical;
+
+ switch (roleValue()) {
+ case ComboBoxRole:
+ case ListBoxRole:
+ case MenuRole:
+ case ScrollBarRole:
+ case TreeRole:
+ if (orientation == AccessibilityOrientationUndefined)
+ orientation = AccessibilityOrientationVertical;
+
+ return orientation;
+ case MenuBarRole:
+ case SliderRole:
+ case SplitterRole:
+ case TabListRole:
+ case ToolbarRole:
+ if (orientation == AccessibilityOrientationUndefined)
+ orientation = AccessibilityOrientationHorizontal;
+
+ return orientation;
+ case RadioGroupRole:
+ case TreeGridRole:
+ // TODO(nektar): Fix bug 532670 and remove table role.
+ case TableRole:
+ return orientation;
+ default:
+ return AXObject::orientation();
+ }
+}
+
String AXNodeObject::text() const
{
// If this is a user defined static text, use the accessible name computation.
« no previous file with comments | « Source/modules/accessibility/AXNodeObject.h ('k') | Source/modules/accessibility/AXObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698