Bug 87778

Summary: [Chromium] AX: WebAccessibilityObject should check if an AccessibilityObject is detached
Product: WebKit Reporter: Dominic Mazzoni <dmazzoni>
Component: AccessibilityAssignee: Dominic Mazzoni <dmazzoni>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, cfleizach, darin, dglazkov, fishd, jamesr, tkent+wkapi, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Archive of layout-test-results from ec2-cr-linux-02
none
Patch
none
Patch
none
Patch
none
Patch for landing
none
Patch none

Dominic Mazzoni
Reported 2012-05-29 14:34:12 PDT
If an AccessibilityObject is detached, any WebAccessibilityObject methods should return an empty or default value.
Attachments
Patch (26.85 KB, patch)
2012-05-29 14:38 PDT, Dominic Mazzoni
no flags
Archive of layout-test-results from ec2-cr-linux-02 (489.57 KB, application/zip)
2012-05-29 18:44 PDT, WebKit Review Bot
no flags
Patch (35.17 KB, patch)
2012-05-29 23:27 PDT, Dominic Mazzoni
no flags
Patch (35.18 KB, patch)
2012-05-29 23:30 PDT, Dominic Mazzoni
no flags
Patch (35.19 KB, patch)
2012-05-30 08:43 PDT, Dominic Mazzoni
no flags
Patch for landing (35.21 KB, patch)
2012-05-30 10:12 PDT, Dominic Mazzoni
no flags
Patch (35.28 KB, patch)
2012-05-30 11:53 PDT, Dominic Mazzoni
no flags
Dominic Mazzoni
Comment 1 2012-05-29 14:38:21 PDT
WebKit Review Bot
Comment 2 2012-05-29 14:43:01 PDT
Please wait for approval from abarth@webkit.org, dglazkov@chromium.org, fishd@chromium.org, jamesr@chromium.org or tkent@chromium.org before submitting, as this patch contains changes to the Chromium public API. See also https://trac.webkit.org/wiki/ChromiumWebKitAPI.
chris fleizach
Comment 3 2012-05-29 16:23:28 PDT
Comment on attachment 144622 [details] Patch looks ok to me.
Adam Barth
Comment 4 2012-05-29 16:48:18 PDT
Comment on attachment 144622 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=144622&action=review One minor comment, otherwise looks good. > Source/WebKit/chromium/public/WebAccessibilityObject.h:72 > + bool isDetached() const; This needs to be marked WEBKIT_EXPORT
WebKit Review Bot
Comment 5 2012-05-29 18:44:07 PDT
Comment on attachment 144622 [details] Patch Attachment 144622 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/12839818 New failing tests: accessibility/loading-iframe-sends-notification.html platform/chromium/accessibility/add-to-menu-list-crashes.html accessibility/image-map1.html accessibility/selection-states.html accessibility/multiselect-list-reports-active-option.html accessibility/loading-iframe-updates-axtree.html
WebKit Review Bot
Comment 6 2012-05-29 18:44:12 PDT
Created attachment 144670 [details] Archive of layout-test-results from ec2-cr-linux-02 The attached test failures were seen while running run-webkit-tests on the chromium-ews. Bot: ec2-cr-linux-02 Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'> Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
Dominic Mazzoni
Comment 7 2012-05-29 23:27:37 PDT
Dominic Mazzoni
Comment 8 2012-05-29 23:30:30 PDT
Dominic Mazzoni
Comment 9 2012-05-29 23:35:58 PDT
Please take another look. It ended up being slightly more complicated, I didn't realize this would break existing tests, but this was a change that was needed anyway. The original patch worked for AccessibilityRenderObject but not other subclasses of AccessibilityObject. Explanation: for all other ports, there's one wrapper for every AccessibilityObject. When the AccessibilityObject is detached, it detaches the wrapper. The wrapper is typically a native refcounted object, so if the operating system is still holding onto a reference, the wrapper will persist, but its getters won't do anything because it's detached. For the Chromium port, the native accessibility objects are in a different process, so we don't need native wrappers. The AccessibilityObjectWrapper code was never used, so I deleted it. Instead, AccessibilityObject just keeps track or whether or not it's detached - for all objects, not just AccessibilityRenderObject. That way the Chromium port can figure out if it has a detached object without needing a wrapper.
chris fleizach
Comment 10 2012-05-30 08:11:58 PDT
Comment on attachment 144723 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=144723&action=review > Source/WebCore/accessibility/AccessibilityObject.cpp:102 > + return true; should the default isDetached return whether the wrapper == nil? > Source/WebKit/chromium/src/WebAccessibilityObject.cpp:107 > m_private->updateBackingStore(); is it worth combining isDetached() and m_private->updateBackingStore()? i see that would save you from duplicating that same code in every method. it would also help catch causes where updateBackingStore may not be called (like performDefaultAction)
Dominic Mazzoni
Comment 11 2012-05-30 08:18:12 PDT
(In reply to comment #10) > (From update of attachment 144723 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=144723&action=review > > > Source/WebCore/accessibility/AccessibilityObject.cpp:102 > > + return true; > > should the default isDetached return whether the wrapper == nil? I can't find any place where isDetached is used on Mac or any other platform. On any other platform, detaching directly disconnects the native wrapper so that it no longer has a pointer to the AccessibilityObject. Only in Chromium do we keep around a reference to an AccessibilityObject for a little while longer (and FYI, only while a notification is queued). So I'm happy to add it, if it makes more sense, for future use? > > Source/WebKit/chromium/src/WebAccessibilityObject.cpp:107 > > m_private->updateBackingStore(); > > is it worth combining isDetached() and m_private->updateBackingStore()? > > i see that would save you from duplicating that same code in every method. it would also help catch causes where updateBackingStore may not be called (like performDefaultAction) Agreed! Let's do this in a separate change, though - I think the best solution would be to directly expose updateBackingStore in WebKit so that accessibility calls can be batched. Sound good?
chris fleizach
Comment 12 2012-05-30 08:20:12 PDT
(In reply to comment #11) > (In reply to comment #10) > > (From update of attachment 144723 [details] [details]) > > View in context: https://bugs.webkit.org/attachment.cgi?id=144723&action=review > > > > > Source/WebCore/accessibility/AccessibilityObject.cpp:102 > > > + return true; > > > > should the default isDetached return whether the wrapper == nil? > > I can't find any place where isDetached is used on Mac or any other platform. On any other platform, detaching directly disconnects the native wrapper so that it no longer has a pointer to the AccessibilityObject. Only in Chromium do we keep around a reference to an AccessibilityObject for a little while longer (and FYI, only while a notification is queued). > > So I'm happy to add it, if it makes more sense, for future use? I think we should change it now, because as it stands, it is returning false information. > > > > Source/WebKit/chromium/src/WebAccessibilityObject.cpp:107 > > > m_private->updateBackingStore(); > > > > is it worth combining isDetached() and m_private->updateBackingStore()? > > > > i see that would save you from duplicating that same code in every method. it would also help catch causes where updateBackingStore may not be called (like performDefaultAction) > > Agreed! Let's do this in a separate change, though - I think the best solution would be to directly expose updateBackingStore in WebKit so that accessibility calls can be batched. Sound good? Sounds good
Dominic Mazzoni
Comment 13 2012-05-30 08:43:19 PDT
Early Warning System Bot
Comment 14 2012-05-30 10:02:14 PDT
Dominic Mazzoni
Comment 15 2012-05-30 10:12:40 PDT
Created attachment 144854 [details] Patch for landing
Adam Barth
Comment 16 2012-05-30 11:38:42 PDT
Comment on attachment 144854 [details] Patch for landing View in context: https://bugs.webkit.org/attachment.cgi?id=144854&action=review > Source/WebCore/accessibility/AccessibilityObject.cpp:92 > -#if HAVE(ACCESSIBILITY) > +#if PLATFORM(CHROMIUM) > + m_detached = true; > +#elif HAVE(ACCESSIBILITY) These ifdefs don't look quite right. PLATFORM(CHROMIUM) can build with HAVE(ACCESSIBILITY) and !HAVE(ACCESSIBILITY). It seems strange to couple these two ifdefs.
Dominic Mazzoni
Comment 17 2012-05-30 11:53:58 PDT
Dominic Mazzoni
Comment 18 2012-05-30 11:55:03 PDT
(In reply to comment #16) > (From update of attachment 144854 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=144854&action=review > > > Source/WebCore/accessibility/AccessibilityObject.cpp:92 > > -#if HAVE(ACCESSIBILITY) > > +#if PLATFORM(CHROMIUM) > > + m_detached = true; > > +#elif HAVE(ACCESSIBILITY) > > These ifdefs don't look quite right. PLATFORM(CHROMIUM) can build with HAVE(ACCESSIBILITY) and !HAVE(ACCESSIBILITY). It seems strange to couple these two ifdefs. You're right. I fixed it, now the ifdefs are consistent with whether setWrapper() and wrapper() are defined in AccessibilityObject.h.
Adam Barth
Comment 19 2012-05-30 13:20:31 PDT
Comment on attachment 144887 [details] Patch Thanks. Do you want me to forward Chris' R+, or should we wait for him to R+ this patch himself?
Dominic Mazzoni
Comment 20 2012-05-30 13:30:03 PDT
(In reply to comment #19) > (From update of attachment 144887 [details]) > Thanks. Do you want me to forward Chris' R+, or should we wait for him to R+ this patch himself? I think it'd be okay to forward the R+ if you don't mind, since Chris was happy with it before and we only made this one small change. Thanks.
Adam Barth
Comment 21 2012-05-30 13:30:38 PDT
Comment on attachment 144887 [details] Patch Done.
WebKit Review Bot
Comment 22 2012-05-30 18:14:35 PDT
Comment on attachment 144887 [details] Patch Clearing flags on attachment: 144887 Committed r119012: <http://trac.webkit.org/changeset/119012>
WebKit Review Bot
Comment 23 2012-05-30 18:14:42 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.