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

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

Issue 1379803002: Adds class, id and src attributes to object attributes of IA2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Test Results Created 5 years, 2 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 7f77ad28ac986eb41b4a5fc0886265c3121ad474..f6a2bae1ecf77b66b33240cdc3c33deb3badf816 100644
--- a/content/browser/accessibility/browser_accessibility_win.cc
+++ b/content/browser/accessibility/browser_accessibility_win.cc
@@ -3400,35 +3400,7 @@ void BrowserAccessibilityWin::UpdateStep1ComputeWinAttributes() {
relations_.push_back(relation);
}
- // Expose slider value.
- if (ia_role() == ROLE_SYSTEM_PROGRESSBAR ||
- ia_role() == ROLE_SYSTEM_SCROLLBAR ||
- ia_role() == ROLE_SYSTEM_SLIDER) {
- win_attributes_->ia2_attributes.push_back(L"valuetext:" + GetValueText());
- }
-
- // Expose dropeffect attribute.
- base::string16 dropEffect;
- if (GetHtmlAttribute("aria-dropeffect", &dropEffect))
- win_attributes_->ia2_attributes.push_back(L"dropeffect:" + dropEffect);
-
- // Expose grabbed attribute.
- base::string16 grabbed;
- if (GetHtmlAttribute("aria-grabbed", &grabbed))
- win_attributes_->ia2_attributes.push_back(L"grabbed:" + grabbed);
-
- // Expose datetime attribute.
- base::string16 datetime;
- if (GetRole() == ui::AX_ROLE_TIME &&
- GetHtmlAttribute("datetime", &datetime))
- win_attributes_->ia2_attributes.push_back(L"datetime:" + datetime);
-
- // Expose input-text type attribute.
- base::string16 type;
- if (GetRole() == ui::AX_ROLE_TEXT_FIELD &&
- GetHtmlAttribute("type", &type))
- win_attributes_->ia2_attributes.push_back(L"text-input-type:" + type);
-
+ 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
// is not exposed to AT.
@@ -4062,6 +4034,52 @@ bool BrowserAccessibilityWin::IsListBoxOptionOrMenuListOption() {
return false;
}
+void BrowserAccessibilityWin::UpdateRequiredAttributes() {
+ // Expose slider value.
+ if (ia_role() == ROLE_SYSTEM_PROGRESSBAR ||
+ ia_role() == ROLE_SYSTEM_SCROLLBAR ||
+ ia_role() == ROLE_SYSTEM_SLIDER)
+ win_attributes_->ia2_attributes.push_back(L"valuetext:" + GetValueText());
+
+ // Expose dropeffect attribute.
+ base::string16 dropEffect;
+ if (GetHtmlAttribute("aria-dropeffect", &dropEffect))
+ win_attributes_->ia2_attributes.push_back(L"dropeffect:" + dropEffect);
+
+ // Expose grabbed attribute.
+ base::string16 grabbed;
+ if (GetHtmlAttribute("aria-grabbed", &grabbed))
+ win_attributes_->ia2_attributes.push_back(L"grabbed:" + grabbed);
+
+ // Expose class attribute.
+ base::string16 class_attr;
+ if (GetHtmlAttribute("class", &class_attr))
+ win_attributes_->ia2_attributes.push_back(L"class:" + class_attr);
+
+ // Expose datetime attribute.
+ base::string16 datetime;
+ if (GetRole() == ui::AX_ROLE_TIME &&
+ GetHtmlAttribute("datetime", &datetime))
+ win_attributes_->ia2_attributes.push_back(L"datetime:" + datetime);
+
+ // Expose id attribute.
+ base::string16 id;
+ if (GetHtmlAttribute("id", &id))
+ win_attributes_->ia2_attributes.push_back(L"id:" + id);
+
+ // Expose src attribute.
+ base::string16 src;
+ if (GetRole() == ui::AX_ROLE_IMAGE &&
+ GetHtmlAttribute("src", &src))
+ win_attributes_->ia2_attributes.push_back(L"src:" + src);
+
+ // Expose input-text type attribute.
+ base::string16 type;
+ if (GetRole() == ui::AX_ROLE_TEXT_FIELD &&
dmazzoni 2015/10/12 22:31:39 Perhaps we should check if the HTML tag is "input"
je_julie(Not used) 2015/10/13 16:54:09 Done.
+ GetHtmlAttribute("type", &type))
+ win_attributes_->ia2_attributes.push_back(L"text-input-type:" + type);
+}
+
void BrowserAccessibilityWin::InitRoleAndState() {
int32 ia_role = 0;
int32 ia_state = 0;

Powered by Google App Engine
This is Rietveld 408576698