Title: [258349] trunk/Source/WebCore
Revision
258349
Author
[email protected]
Date
2020-03-12 12:06:54 -0700 (Thu, 12 Mar 2020)

Log Message

Attributes SelectionTextMarkerRange and Start/EndTextMarker need to run on the main thread.
https://bugs.webkit.org/show_bug.cgi?id=208996

Reviewed by Chris Fleizach.

Covered by existing tests.

Dispatch to the main thread the computation of these accessibility attributes.

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (258348 => 258349)


--- trunk/Source/WebCore/ChangeLog	2020-03-12 19:02:48 UTC (rev 258348)
+++ trunk/Source/WebCore/ChangeLog	2020-03-12 19:06:54 UTC (rev 258349)
@@ -1,5 +1,19 @@
 2020-03-12  Andres Gonzalez  <[email protected]>
 
+        Attributes SelectionTextMarkerRange and Start/EndTextMarker need to run on the main thread.
+        https://bugs.webkit.org/show_bug.cgi?id=208996
+
+        Reviewed by Chris Fleizach.
+
+        Covered by existing tests.
+
+        Dispatch to the main thread the computation of these accessibility attributes.
+
+        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+        (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
+
+2020-03-12  Andres Gonzalez  <[email protected]>
+
         AX: Isolated tree: Crash in URL retrieval
         https://bugs.webkit.org/show_bug.cgi?id=208942
         <rdar://problem/60337588>

Modified: trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (258348 => 258349)


--- trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm	2020-03-12 19:02:48 UTC (rev 258348)
+++ trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm	2020-03-12 19:06:54 UTC (rev 258349)
@@ -2826,14 +2826,28 @@
     if (backingObject->isList() && [attributeName isEqualToString:NSAccessibilityOrientationAttribute])
         return NSAccessibilityVerticalOrientationValue;
 
-    if ([attributeName isEqualToString: @"AXSelectedTextMarkerRange"])
-        return [self textMarkerRangeForSelection];
+    if ([attributeName isEqualToString:@"AXSelectedTextMarkerRange"]) {
+        return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([protectedSelf = RetainPtr<WebAccessibilityObjectWrapper>(self)] () -> RetainPtr<id> {
+            return [protectedSelf textMarkerRangeForSelection];
+        });
+    }
 
-    if ([attributeName isEqualToString: @"AXStartTextMarker"])
-        return [self textMarkerForVisiblePosition:startOfDocument(backingObject->document())];
-    if ([attributeName isEqualToString: @"AXEndTextMarker"])
-        return [self textMarkerForVisiblePosition:endOfDocument(backingObject->document())];
+    if ([attributeName isEqualToString:@"AXStartTextMarker"]) {
+        return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([protectedSelf = RetainPtr<WebAccessibilityObjectWrapper>(self)] () -> RetainPtr<id> {
+            if (auto* backingObject = protectedSelf.get().axBackingObject)
+                return [protectedSelf textMarkerForVisiblePosition:startOfDocument(backingObject->document())];
+            return nil;
+        });
+    }
 
+    if ([attributeName isEqualToString:@"AXEndTextMarker"]) {
+        return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([protectedSelf = RetainPtr<WebAccessibilityObjectWrapper>(self)] () -> RetainPtr<id> {
+            if (auto* backingObject = protectedSelf.get().axBackingObject)
+                return [protectedSelf textMarkerForVisiblePosition:endOfDocument(backingObject->document())];
+            return nil;
+        });
+    }
+
     if ([attributeName isEqualToString:NSAccessibilityBlockQuoteLevelAttribute])
         return [NSNumber numberWithUnsignedInt:backingObject->blockquoteLevel()];
     if ([attributeName isEqualToString:@"AXTableLevel"])
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to