Title: [287778] trunk/Source/WebCore
Revision
287778
Author
andresg...@apple.com
Date
2022-01-07 13:09:21 -0800 (Fri, 07 Jan 2022)

Log Message

WebAccessibilityObjectWrapper accessibilityHitTest should call AXCoreObject::widget() on the main thread.
https://bugs.webkit.org/show_bug.cgi?id=234973
<rdar://problem/87264153>

Reviewed by Chris Fleizach.

In isolated tree mode, the AX object widget() method and any subsequent
access to the returned value must be dispatch to the main thread.

* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityHitTest:]):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (287777 => 287778)


--- trunk/Source/WebCore/ChangeLog	2022-01-07 20:28:04 UTC (rev 287777)
+++ trunk/Source/WebCore/ChangeLog	2022-01-07 21:09:21 UTC (rev 287778)
@@ -1,3 +1,17 @@
+2022-01-07  Andres Gonzalez  <andresg...@apple.com>
+
+        WebAccessibilityObjectWrapper accessibilityHitTest should call AXCoreObject::widget() on the main thread.
+        https://bugs.webkit.org/show_bug.cgi?id=234973
+        <rdar://problem/87264153>
+
+        Reviewed by Chris Fleizach.
+
+        In isolated tree mode, the AX object widget() method and any subsequent
+        access to the returned value must be dispatch to the main thread.
+
+        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+        (-[WebAccessibilityObjectWrapper accessibilityHitTest:]):
+
 2022-01-07  Wenson Hsieh  <wenson_hs...@apple.com>
 
         Teach modal container observer to make the body element scrollable if necessary

Modified: trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (287777 => 287778)


--- trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm	2022-01-07 20:28:04 UTC (rev 287777)
+++ trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm	2022-01-07 21:09:21 UTC (rev 287778)
@@ -2952,15 +2952,24 @@
     backingObject->updateChildrenIfNecessary();
     auto* axObject = backingObject->accessibilityHitTest(IntPoint(point));
 
+    id hit = nil;
     if (axObject) {
         if (axObject->isAttachment() && [axObject->wrapper() attachmentView])
             return [axObject->wrapper() attachmentView];
-        auto* widget = axObject->widget();
-        if (is<PluginViewBase>(widget))
-            return NSAccessibilityUnignoredAncestor(widget->accessibilityHitTest(IntPoint(point)));
-        return NSAccessibilityUnignoredAncestor(axObject->wrapper());
-    }
-    return NSAccessibilityUnignoredAncestor(self);
+
+        hit = Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&axObject, &point] () -> RetainPtr<id> {
+            auto* widget = axObject->widget();
+            if (is<PluginViewBase>(widget))
+                return widget->accessibilityHitTest(IntPoint(point));
+            return nil;
+        });
+
+        if (!hit)
+            hit = axObject->wrapper();
+    } else
+        hit = self;
+
+    return NSAccessibilityUnignoredAncestor(hit);
 }
 
 ALLOW_DEPRECATED_IMPLEMENTATIONS_BEGIN
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to