tests/cefclient/browser/osr_accessibility_node_win.cc
// Returns a child IAccessible object.
Returns a child IAccessible object.
Returns a child IAccessible object .
STDMETHODIMP CefIAccessible::get_accChild(VARIANT varChild,
                                          IDispatch** ppdispChild) {
  HRESULT retCode = DATACHECK(node_);
  if (SUCCEEDED(retCode)) {
    int numChilds = node_->GetChildCount();
    if (numChilds <= 0) {
      *ppdispChild = nullptr;
      return S_FALSE;
    } else {
      if (ppdispChild && VALID_CHILDID(varChild)) {
        if (varChild.lVal == CHILDID_SELF) {
          *ppdispChild = this;
        } else {
          OsrAXNode* child = node_->ChildAtIndex(varChild.lVal - 1);
          if (!child)
            child = node_->GetAccessibilityHelper()->GetFocusedNode();
          *ppdispChild = child->GetNativeAccessibleObject(node_);
        }
        if (*ppdispChild == nullptr)
          retCode = S_FALSE;
        else
          (*ppdispChild)->AddRef();
      }
    }
  }
  return retCode;
}
STDMETHODIMP CefIAccessible :: get_accChild ( VARIANT varChild , IDispatch * * ppdispChild ) { HRESULT retCode = DATACHECK ( node_ ) ; if ( SUCCEEDED ( retCode ) ) { int numChilds = node_ -> GetChildCount ( ) ; if ( numChilds <= 0 ) { * ppdispChild = nullptr ; return S_FALSE ; } else { if ( ppdispChild && VALID_CHILDID ( varChild ) ) { if ( varChild . lVal == CHILDID_SELF ) { * ppdispChild = this ; } else { OsrAXNode * child = node_ -> ChildAtIndex ( varChild . lVal - 1 ) ; if ( ! child ) child = node_ -> GetAccessibilityHelper ( ) -> GetFocusedNode ( ) ; * ppdispChild = child -> GetNativeAccessibleObject ( node_ ) ; } if ( * ppdispChild == nullptr ) retCode = S_FALSE ; else ( * ppdispChild ) -> AddRef ( ) ; } } } return retCode ; }
Returns a child IAccessible object.
Returns a child IAccessible object .
// Mark Leaf node if there are no child // Convert to 0 based index and get Child Node. // Fallback to focused node