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

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: Fixed Android test expectations. Created 5 years, 10 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 a5501590560641bc29135659cfbbcbfaa15b6bdb..f08375dbf250baa208f172c7f85fe5555fbf7e25 100644
--- a/content/browser/accessibility/browser_accessibility_win.cc
+++ b/content/browser/accessibility/browser_accessibility_win.cc
@@ -3038,8 +3038,6 @@ void BrowserAccessibilityWin::UpdateStep1ComputeWinAttributes() {
// 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:
- break;
case ui::AX_INVALID_STATE_FALSE:
win_attributes_->ia2_attributes.push_back(L"invalid:false");
break;
@@ -3070,6 +3068,29 @@ void BrowserAccessibilityWin::UpdateStep1ComputeWinAttributes() {
}
}
+ // 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:
+ win_attributes_->ia2_attributes.push_back(L"sort:none");
+ break;
+ case ui::AX_SORT_DIRECTION_ASCENDING:
+ win_attributes_->ia2_attributes.push_back(L"sort:ascending");
+ break;
+ case ui::AX_SORT_DIRECTION_DESCENDING:
+ win_attributes_->ia2_attributes.push_back(L"sort:descending");
+ break;
+ case ui::AX_SORT_DIRECTION_OTHER:
+ win_attributes_->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