Commit 4f3d6445 authored by dougt's avatar dougt Committed by Commit bot

Forward BrowserAccessibilityWin::get_accName to platform node.

BUG=703369

Review-Url: https://codereview.chromium.org/2855463003
Cr-Commit-Position: refs/heads/master@{#468422}
parent c4ac18d1
......@@ -659,29 +659,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_accName(VARIANT var_id, BSTR* name) {
if (!instance_active())
return E_FAIL;
if (!name)
return E_INVALIDARG;
BrowserAccessibilityWin* target = GetTargetFromChildID(var_id);
if (!target)
return E_INVALIDARG;
base::string16 name_str = target->name();
if (name_str.empty()) {
if (target->ia2_role() == ROLE_SYSTEM_DOCUMENT && PlatformGetParent()) {
// Hack: Some versions of JAWS crash if they get an empty name on
// a document that's the child of an iframe, so always return a
// nonempty string for this role. https://crbug.com/583057
name_str = L" ";
} else {
return S_FALSE;
}
}
*name = SysAllocString(name_str.c_str());
DCHECK(*name);
return S_OK;
return GetPlatformNodeWin()->get_accName(var_id, name);
}
STDMETHODIMP BrowserAccessibilityWin::get_accParent(IDispatch** disp_parent) {
......
......@@ -474,7 +474,17 @@ STDMETHODIMP AXPlatformNodeWin::get_accName(
AXPlatformNodeWin* target;
COM_OBJECT_VALIDATE_VAR_ID_1_ARG_AND_GET_TARGET(var_id, name, target);
return target->GetStringAttributeAsBstr(ui::AX_ATTR_NAME, name);
HRESULT result = target->GetStringAttributeAsBstr(ui::AX_ATTR_NAME, name);
if (FAILED(result) && MSAARole() == ROLE_SYSTEM_DOCUMENT && GetParent()) {
// Hack: Some versions of JAWS crash if they get an empty name on
// a document that's the child of an iframe, so always return a
// nonempty string for this role. https://crbug.com/583057
base::string16 str = L" ";
*name = SysAllocString(str.c_str());
DCHECK(*name);
}
return result;
}
STDMETHODIMP AXPlatformNodeWin::get_accParent(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment