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

Unified Diff: content/browser/accessibility/browser_accessibility_win.cc

Issue 744843002: Added the aria-sort state to the accessibility tree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Separated ARIA grid and HTML table tests. Created 5 years, 11 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
Index: content/browser/accessibility/browser_accessibility_win.cc
diff --git a/content/browser/accessibility/browser_accessibility_win.cc b/content/browser/accessibility/browser_accessibility_win.cc
index 752d1539ca43f4216c36025941d88ef5a081165d..810e2d7b95f0134b148f3705b0dae3bbf69b562a 100644
--- a/content/browser/accessibility/browser_accessibility_win.cc
+++ b/content/browser/accessibility/browser_accessibility_win.cc
@@ -2986,8 +2986,6 @@ void BrowserAccessibilityWin::OnDataChanged() {
// TODO(nektar): Handle the possibility of having multiple aria-invalid
// attributes defined, e.g., "invalid:spelling,grammar".
switch (invalid_state) {
- case ui::AX_INVALID_STATE_NONE:
dmazzoni 2015/01/27 18:59:17 This isn't related to the sort change
- break;
case ui::AX_INVALID_STATE_FALSE:
ia2_attributes_.push_back(L"invalid:false");
break;
@@ -3017,6 +3015,29 @@ void BrowserAccessibilityWin::OnDataChanged() {
}
}
+ // Expose row or column header sort direction.
+ int32 sort_direction;
+ if ((ia_role_ == ROLE_SYSTEM_COLUMNHEADER ||
+ ia_role_ == ROLE_SYSTEM_ROWHEADER) &&
+ GetIntAttribute(ui::AX_ATTR_SORT_DIRECTION, &sort_direction)) {
+ switch (sort_direction) {
+ case ui::AX_SORT_DIRECTION_UNSORTED:
+ ia2_attributes_.push_back(L"sort:none");
+ break;
+ case ui::AX_SORT_DIRECTION_ASCENDING:
+ ia2_attributes_.push_back(L"sort:ascending");
+ break;
+ case ui::AX_SORT_DIRECTION_DESCENDING:
+ ia2_attributes_.push_back(L"sort:descending");
+ break;
+ case ui::AX_SORT_DIRECTION_OTHER:
+ ia2_attributes_.push_back(L"sort:other");
+ break;
+ default:
+ NOTREACHED();
+ }
+ }
+
// The calculation of the accessible name of an element has been
// standardized in the HTML to Platform Accessibility APIs Implementation
// Guide (http://www.w3.org/TR/html-aapi/). In order to return the

Powered by Google App Engine
This is Rietveld 408576698