Chromium Code Reviews| 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; |
| } |