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.cc

Issue 1821723002: Exposed the children of elements with role textbox in order to make rich text information available… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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.cc
diff --git a/content/browser/accessibility/browser_accessibility.cc b/content/browser/accessibility/browser_accessibility.cc
index 4afad6bfe73d80ba0d0fd2bf9a450dd19c6eb8d9..be72ae8b878eb9e665f79884c4faf63a0c52739d 100644
--- a/content/browser/accessibility/browser_accessibility.cc
+++ b/content/browser/accessibility/browser_accessibility.cc
@@ -451,8 +451,15 @@ gfx::Rect BrowserAccessibility::GetGlobalBoundsForRange(int start, int len)
base::string16 BrowserAccessibility::GetValue() const {
base::string16 value = GetString16Attribute(ui::AX_ATTR_VALUE);
- if (value.empty() && IsSimpleTextControl())
+ if (value.empty() &&
+ (IsSimpleTextControl() ||
+ // Some screen readers like Jaws and older versions of VoiceOver require
dmazzoni 2016/03/21 17:04:02 Nit: put the comment above or below. Comments in t
+ // a
+ // value to be set in text fields with rich content, even though the same
+ // information is available on the children.
+ IsRichTextControl())) {
value = GetInnerText();
+ }
return value;
}
@@ -829,9 +836,7 @@ bool BrowserAccessibility::IsCellOrTableHeaderRole() const {
}
bool BrowserAccessibility::HasCaret() const {
- if (HasState(ui::AX_STATE_EDITABLE) &&
- !HasState(ui::AX_STATE_RICHLY_EDITABLE) &&
- HasIntAttribute(ui::AX_ATTR_TEXT_SEL_START) &&
+ if (IsSimpleTextControl() && HasIntAttribute(ui::AX_ATTR_TEXT_SEL_START) &&
HasIntAttribute(ui::AX_ATTR_TEXT_SEL_END)) {
return true;
}
@@ -939,8 +944,9 @@ bool BrowserAccessibility::IsSimpleTextControl() const {
switch (GetRole()) {
case ui::AX_ROLE_COMBO_BOX:
case ui::AX_ROLE_SEARCH_BOX:
- case ui::AX_ROLE_TEXT_FIELD:
return true;
+ case ui::AX_ROLE_TEXT_FIELD:
+ return !HasState(ui::AX_STATE_RICHLY_EDITABLE);
default:
return false;
}

Powered by Google App Engine
This is Rietveld 408576698