Chromium Code Reviews| 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 76d15c781ee1483f5875d06a18d728e1b57ece95..ca53aa586bf1e59412028d9349259894934a9939 100644 |
| --- a/content/browser/accessibility/browser_accessibility_win.cc |
| +++ b/content/browser/accessibility/browser_accessibility_win.cc |
| @@ -2650,11 +2650,10 @@ STDMETHODIMP BrowserAccessibilityWin::get_nodeInfo( |
| if (ia_role() == ROLE_SYSTEM_DOCUMENT) { |
| *node_type = NODETYPE_DOCUMENT; |
| - } else if (ia_role() == ROLE_SYSTEM_TEXT && |
| - ((ia2_state() & IA2_STATE_EDITABLE) == 0)) { |
| - *node_type = NODETYPE_TEXT; |
| - } else { |
| + } else if (ia_role() == ROLE_SYSTEM_TEXT && IsEditableText()) { |
|
dmazzoni
2015/09/10 18:44:24
I think you got this backwards. The previous logic
|
| *node_type = NODETYPE_ELEMENT; |
| + } else { |
| + *node_type = NODETYPE_TEXT; |
| } |
| return S_OK; |
| @@ -3753,7 +3752,8 @@ void BrowserAccessibilityWin::GetSelectionOffsets( |
| int* selection_start, int* selection_end) const { |
| DCHECK(selection_start && selection_end); |
| - if (GetIntAttribute(ui::AX_ATTR_TEXT_SEL_START, selection_start) && |
| + if (IsEditableText() && !HasState(ui::AX_STATE_RICHLY_EDITABLE) && |
| + GetIntAttribute(ui::AX_ATTR_TEXT_SEL_START, selection_start) && |
| GetIntAttribute(ui::AX_ATTR_TEXT_SEL_END, selection_end)) { |
| return; |
| } |
| @@ -4012,10 +4012,7 @@ void BrowserAccessibilityWin::InitRoleAndState() { |
| ia_state |= STATE_SYSTEM_HOTTRACKED; |
| } |
| - // WebKit marks everything as readonly unless it's editable text, so if it's |
| - // not readonly, mark it as editable now. The final computation of the |
| - // READONLY state for MSAA is below, after the switch. |
| - if (!HasState(ui::AX_STATE_READ_ONLY)) |
| + if (IsEditableText()) |
| ia2_state |= IA2_STATE_EDITABLE; |
| if (GetBoolAttribute(ui::AX_ATTR_BUTTON_MIXED)) |
| @@ -4427,7 +4424,6 @@ void BrowserAccessibilityWin::InitRoleAndState() { |
| ia2_state |= IA2_STATE_MULTI_LINE; |
| else |
| ia2_state |= IA2_STATE_SINGLE_LINE; |
| - ia2_state |= IA2_STATE_EDITABLE; |
| ia2_state |= IA2_STATE_SELECTABLE_TEXT; |
| break; |
| case ui::AX_ROLE_TIME: |