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

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

Issue 1547643002: ARIA 1.1: implementation for aria-col-* and aria-row-*. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adds MODULES_EXPORT Created 5 years 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 e44e912fff66ebf79124cf6f5a4ef3ef179db159..901666af7a82542abb964881666ca4efff0b4ba8 100644
--- a/content/browser/accessibility/browser_accessibility_win.cc
+++ b/content/browser/accessibility/browser_accessibility_win.cc
@@ -3323,6 +3323,19 @@ void BrowserAccessibilityWin::UpdateStep1ComputeWinAttributes() {
}
}
+ //Expose aria-colcount and aria-rowcount in a table, grid or treegrid
+ if (IsTableOrGridOrTreeGridRole()) {
+ IntAttributeToIA2(ui::AX_ATTR_ARIA_COL_COUNT, "colcount");
+ IntAttributeToIA2(ui::AX_ATTR_ARIA_ROW_COUNT, "rowcount");
+ }
+
+ //Expose aria-colindex and aria-rowindex in a cell or row
+ if (IsCellOrTableHeaderRole() || GetRole() == ui::AX_ROLE_ROW) {
+ if (GetRole() != ui::AX_ROLE_ROW)
+ IntAttributeToIA2(ui::AX_ATTR_ARIA_COL_INDEX, "colindex");
+ IntAttributeToIA2(ui::AX_ATTR_ARIA_ROW_INDEX, "rowindex");
+ }
+
// Expose invalid state for form controls and elements with aria-invalid.
int invalid_state;
if (GetIntAttribute(ui::AX_ATTR_INVALID_STATE, &invalid_state)) {
@@ -3413,6 +3426,15 @@ void BrowserAccessibilityWin::UpdateStep1ComputeWinAttributes() {
AddRelations(ui::AX_ATTR_FLOWTO_IDS, IA2_RELATION_FLOWS_TO);
AddRelations(ui::AX_ATTR_LABELLEDBY_IDS, IA2_RELATION_LABELLED_BY);
+ // Expose slider value.
+ if (ia_role() == ROLE_SYSTEM_PROGRESSBAR ||
+ ia_role() == ROLE_SYSTEM_SCROLLBAR ||
+ ia_role() == ROLE_SYSTEM_SLIDER) {
+ base::string16 value_text = GetValueText();
+ SanitizeStringAttributeForIA2(value_text, &value_text);
+ win_attributes_->ia2_attributes.push_back(L"valuetext:" + value_text);
+ }
+
UpdateRequiredAttributes();
// If this is a web area for a presentational iframe, give it a role of
// something other than DOCUMENT so that the fact that it's a separate doc
@@ -4052,13 +4074,19 @@ bool BrowserAccessibilityWin::IsListBoxOptionOrMenuListOption() {
}
void BrowserAccessibilityWin::UpdateRequiredAttributes() {
- // Expose slider value.
- if (ia_role() == ROLE_SYSTEM_PROGRESSBAR ||
- ia_role() == ROLE_SYSTEM_SCROLLBAR ||
- ia_role() == ROLE_SYSTEM_SLIDER) {
- base::string16 value_text = GetValueText();
- SanitizeStringAttributeForIA2(value_text, &value_text);
- win_attributes_->ia2_attributes.push_back(L"valuetext:" + value_text);
+ if (IsCellOrTableHeaderRole()) {
+ // Expose colspan attribute.
+ base::string16 colspan;
+ if (GetHtmlAttribute("aria-colspan", &colspan)) {
+ SanitizeStringAttributeForIA2(colspan, &colspan);
+ win_attributes_->ia2_attributes.push_back(L"colspan:" + colspan);
+ }
+ // Expose rowspan attribute.
+ base::string16 rowspan;
+ if (GetHtmlAttribute("aria-rowspan", &rowspan)) {
+ SanitizeStringAttributeForIA2(rowspan, &rowspan);
+ win_attributes_->ia2_attributes.push_back(L"rowspan:" + rowspan);
+ }
}
// Expose dropeffect attribute.

Powered by Google App Engine
This is Rietveld 408576698