Changeset 258704 in webkit


Ignore:
Timestamp:
Mar 19, 2020 10:02:26 AM (4 years ago)
Author:
Andres Gonzalez
Message:

[WebAccessibilityObjectWrapper remoteAccessibilityParentObject] must run on the main thread.
https://bugs.webkit.org/show_bug.cgi?id=209284

Reviewed by Chris Fleizach.

  • Dispatch [WebAccessibilityObjectWrapper remoteAccessibilityParentObject] to the main thread.
  • [WebAccessibilityObjectWrapper windowElement:] must then call it outside the dispatched lambda.
  • accessibility/mac/WebAccessibilityObjectWrapperMac.mm:

(-[WebAccessibilityObjectWrapper remoteAccessibilityParentObject]):
(-[WebAccessibilityObjectWrapper windowElement:]):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r258702 r258704  
     12020-03-19  Andres Gonzalez  <andresg_22@apple.com>
     2
     3        [WebAccessibilityObjectWrapper remoteAccessibilityParentObject] must run on the main thread.
     4        https://bugs.webkit.org/show_bug.cgi?id=209284
     5
     6        Reviewed by Chris Fleizach.
     7
     8        - Dispatch [WebAccessibilityObjectWrapper remoteAccessibilityParentObject] to the main thread.
     9        - [WebAccessibilityObjectWrapper windowElement:] must then call it outside the dispatched lambda.
     10
     11        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
     12        (-[WebAccessibilityObjectWrapper remoteAccessibilityParentObject]):
     13        (-[WebAccessibilityObjectWrapper windowElement:]):
     14
    1152020-03-19  Antoine Quint  <graouts@apple.com>
    216
  • trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm

    r258681 r258704  
    18741874- (id)remoteAccessibilityParentObject
    18751875{
    1876     ASSERT(isMainThread());
    1877     if (!self.axBackingObject)
     1876    return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([protectedSelf = retainPtr(self)] () -> RetainPtr<id> {
     1877        auto* backingObject = protectedSelf.get().axBackingObject;
     1878        if (!backingObject)
     1879            return nil;
     1880
     1881        if (auto* document = backingObject->document()) {
     1882            if (auto* frame = document->frame())
     1883                return frame->loader().client().accessibilityRemoteObject();
     1884        }
     1885
    18781886        return nil;
    1879 
    1880     if (auto* document = self.axBackingObject->document()) {
    1881         if (auto* frame = document->frame())
    1882             return frame->loader().client().accessibilityRemoteObject();
    1883     }
    1884 
    1885     return nil;
     1887    });
    18861888}
    18871889
     
    22852287- (id)windowElement:(NSString*)attributeName
    22862288{
    2287     return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([attributeName, protectedSelf = retainPtr(self)] () -> RetainPtr<id> {
    2288         id remoteParent = [protectedSelf remoteAccessibilityParentObject];
    2289         if (remoteParent) {
    2290             ALLOW_DEPRECATED_DECLARATIONS_BEGIN
    2291             return [remoteParent accessibilityAttributeValue:attributeName];
    2292             ALLOW_DEPRECATED_DECLARATIONS_END
    2293         }
    2294 
     2289    if (id remoteParent = self.remoteAccessibilityParentObject) {
     2290        ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     2291        return [remoteParent accessibilityAttributeValue:attributeName];
     2292        ALLOW_DEPRECATED_DECLARATIONS_END
     2293    }
     2294
     2295    return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([protectedSelf = retainPtr(self)] () -> RetainPtr<id> {
    22952296        auto* backingObject = protectedSelf.get().axBackingObject;
    22962297        if (!backingObject)
Note: See TracChangeset for help on using the changeset viewer.