Index: content/browser/accessibility/browser_accessibility_com_win.cc |
diff --git a/content/browser/accessibility/browser_accessibility_com_win.cc b/content/browser/accessibility/browser_accessibility_com_win.cc |
index ad9d0aa0e1c1bd43f3c44f05afe8c2334044257d..005c3c90f35545e21e34e8562d13860ae1c80952 100644 |
--- a/content/browser/accessibility/browser_accessibility_com_win.cc |
+++ b/content/browser/accessibility/browser_accessibility_com_win.cc |
@@ -2866,8 +2866,7 @@ STDMETHODIMP BrowserAccessibilityComWin::get_nodeInfo( |
*num_children = owner()->PlatformChildCount(); |
*unique_id = -owner()->unique_id(); |
- if (owner()->GetRole() == ui::AX_ROLE_ROOT_WEB_AREA || |
- owner()->GetRole() == ui::AX_ROLE_WEB_AREA) { |
+ if (owner()->IsDocument()) { |
*node_type = NODETYPE_DOCUMENT; |
} else if (owner()->IsTextOnlyObject()) { |
*node_type = NODETYPE_TEXT; |
@@ -3711,8 +3710,7 @@ void BrowserAccessibilityComWin::UpdateStep1ComputeWinAttributes() { |
win_attributes_->ia2_attributes.push_back(L"valuetext:" + value); |
} else { |
// On Windows, the value of a document should be its url. |
- if (owner()->GetRole() == ui::AX_ROLE_ROOT_WEB_AREA || |
- owner()->GetRole() == ui::AX_ROLE_WEB_AREA) { |
+ if (owner()->IsDocument()) { |
value = base::UTF8ToUTF16(Manager()->GetTreeData().url); |
} |
// If this doesn't have a value and is linked then set its value to the url |
@@ -5012,9 +5010,22 @@ void BrowserAccessibilityComWin::InitRoleAndState() { |
ia_state |= STATE_SYSTEM_HOTTRACKED; |
} |
- if (owner()->HasState(ui::AX_STATE_EDITABLE)) |
+ const bool is_editable = owner()->HasState(ui::AX_STATE_EDITABLE); |
+ if (is_editable) |
ia2_state |= IA2_STATE_EDITABLE; |
+ if (owner()->IsRichTextControl() || owner()->IsEditBox()) { |
+ // Support multi/single line states if root editable or appropriate role. |
+ // We support the edit box roles even if the area is not actually editable, |
+ // because it is technically feasible for JS to implement the edit box |
+ // by controlling selection. |
+ if (owner()->HasState(ui::AX_STATE_MULTILINE)) { |
+ ia2_state |= IA2_STATE_MULTI_LINE; |
+ } else { |
+ ia2_state |= IA2_STATE_SINGLE_LINE; |
+ } |
+ } |
+ |
if (!owner()->GetStringAttribute(ui::AX_ATTR_AUTO_COMPLETE).empty()) |
ia2_state |= IA2_STATE_SUPPORTS_AUTOCOMPLETION; |
@@ -5411,11 +5422,6 @@ void BrowserAccessibilityComWin::InitRoleAndState() { |
case ui::AX_ROLE_TEXT_FIELD: |
case ui::AX_ROLE_SEARCH_BOX: |
ia_role = ROLE_SYSTEM_TEXT; |
- if (owner()->HasState(ui::AX_STATE_MULTILINE)) { |
- ia2_state |= IA2_STATE_MULTI_LINE; |
- } else { |
- ia2_state |= IA2_STATE_SINGLE_LINE; |
- } |
if (owner()->HasState(ui::AX_STATE_READ_ONLY)) |
ia_state |= STATE_SYSTEM_READONLY; |
ia2_state |= IA2_STATE_SELECTABLE_TEXT; |