| Index: ui/accessibility/platform/ax_platform_node_win.cc
|
| diff --git a/ui/accessibility/platform/ax_platform_node_win.cc b/ui/accessibility/platform/ax_platform_node_win.cc
|
| index 95632d8e558266b1f6f1fabd15aed766e36c753c..4684b7eb38d45aee08155bc4defbc84e5f4681cc 100644
|
| --- a/ui/accessibility/platform/ax_platform_node_win.cc
|
| +++ b/ui/accessibility/platform/ax_platform_node_win.cc
|
| @@ -333,17 +333,20 @@ STDMETHODIMP AXPlatformNodeWin::get_accChild(VARIANT var_child,
|
| // that want to enumerate all immediate children.
|
| *disp_child = delegate_->ChildAtIndex(child_id - 1);
|
| if (!(*disp_child))
|
| - return E_FAIL;
|
| + return E_INVALIDARG;
|
| (*disp_child)->AddRef();
|
| return S_OK;
|
| }
|
|
|
| if (child_id >= 0)
|
| - return E_FAIL;
|
| + return E_INVALIDARG;
|
|
|
| // Negative child ids can be used to map to any descendant.
|
| AXPlatformNodeWin* child = static_cast<AXPlatformNodeWin*>(
|
| GetFromUniqueId(-child_id));
|
| + if (child && !IsDescendant(child))
|
| + child = nullptr;
|
| +
|
| if (child) {
|
| *disp_child = child;
|
| (*disp_child)->AddRef();
|
| @@ -351,7 +354,7 @@ STDMETHODIMP AXPlatformNodeWin::get_accChild(VARIANT var_child,
|
| }
|
|
|
| *disp_child = nullptr;
|
| - return E_FAIL;
|
| + return E_INVALIDARG;
|
| }
|
|
|
| STDMETHODIMP AXPlatformNodeWin::get_accChildCount(LONG* child_count) {
|
|
|