Bug 22893 - get_accParent should try to retrieve parent AccessibilityObject, before calling upon window
Summary: get_accParent should try to retrieve parent AccessibilityObject, before calli...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Normal
Assignee: Jon Honeycutt
URL:
Keywords: InRadar
: 22895 (view as bug list)
Depends on: 23579
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-16 16:14 PST by Jonas Klink
Modified: 2010-01-16 20:16 PST (History)
1 user (show)

See Also:


Attachments
Fixes the issue described in this bug. (1.26 KB, patch)
2008-12-16 18:21 PST, Jonas Klink
jhoneycutt: review-
Details | Formatted Diff | Diff
patch (6.42 KB, patch)
2010-01-15 21:43 PST, Jon Honeycutt
darin: review+
jhoneycutt: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jonas Klink 2008-12-16 16:14:58 PST
In AccessibleBase::get_accParent, the parent AccessibilityObject should first be attempted to be retrieved. Only if this fails should we query the WebView::AccessibleObjectFromWindow for an IAccessible implementation.
Comment 1 Jonas Klink 2008-12-16 17:19:46 PST
*** Bug 22895 has been marked as a duplicate of this bug. ***
Comment 2 Jonas Klink 2008-12-16 18:21:41 PST
Created attachment 26081 [details]
Fixes the issue described in this bug.
Comment 3 Jon Honeycutt 2008-12-17 14:27:41 PST
Comment on attachment 26081 [details]
Fixes the issue described in this bug.


>  
> +    AccessibilityObject* parentObj = m_object->parentObjectUnignored();
> +
> +    if (parentObj) {
> +        *parent = static_cast<IDispatch*>(wrapper(parentObj));
> +        (*parent)->AddRef();
> +        return S_OK;
> +    }
> +
>      return WebView::AccessibleObjectFromWindow(m_object->topDocumentFrameView()->hostWindow()->platformWindow(),
>          OBJID_WINDOW, __uuidof(IAccessible), reinterpret_cast<void**>(parent));
>  }

Our coding style prefers early returns, so this would be better written as:

if (!parentObject) {
    return WebView::AccessibleObjectFromWindow(m_object->topDocumentFrameView()->hostWindow()->platformWindow(),
        OBJID_WINDOW, __uuidof(IAccessible), reinterpret_cast<void**>(parent));
}
*parent = static_cast<IDispatch*>(wrapper(parentObj));
(*parent)->AddRef();
return S_OK;

The change looks correct, but it will need a layout test for the new behavior. r- for this reason.

Thanks for the patch, Jonas!
Comment 4 Jon Honeycutt 2010-01-15 21:43:35 PST
Created attachment 46734 [details]
patch
Comment 5 Jon Honeycutt 2010-01-16 20:14:45 PST
Committed in r53368.
Comment 6 Jon Honeycutt 2010-01-16 20:16:17 PST
<rdar://problem/7549921>