Title: [254207] trunk/Source/WebCore
Revision
254207
Author
[email protected]
Date
2020-01-08 11:15:04 -0800 (Wed, 08 Jan 2020)

Log Message

Fix for parameterized attribute TextMarkerRangeForUIElement which should run ion main thread.
https://bugs.webkit.org/show_bug.cgi?id=205920

Reviewed by Chris Fleizach.

Parameterized attribute TextMarkerRangeForUIElement must run on main
thread since it invokes DOM Range methods.

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (254206 => 254207)


--- trunk/Source/WebCore/ChangeLog	2020-01-08 19:02:11 UTC (rev 254206)
+++ trunk/Source/WebCore/ChangeLog	2020-01-08 19:15:04 UTC (rev 254207)
@@ -1,3 +1,16 @@
+2020-01-08  Andres Gonzalez  <[email protected]>
+
+        Fix for parameterized attribute TextMarkerRangeForUIElement which should run ion main thread.
+        https://bugs.webkit.org/show_bug.cgi?id=205920
+
+        Reviewed by Chris Fleizach.
+
+        Parameterized attribute TextMarkerRangeForUIElement must run on main
+        thread since it invokes DOM Range methods.
+
+        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+        (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
+
 2020-01-08  Wenson Hsieh  <[email protected]>
 
         Add encoding/decoding support for data structures in TextFlags.h

Modified: trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (254206 => 254207)


--- trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm	2020-01-08 19:02:11 UTC (rev 254206)
+++ trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm	2020-01-08 19:15:04 UTC (rev 254207)
@@ -4009,12 +4009,14 @@
             return [axObject->wrapper() attachmentView];
         return axObject->wrapper();
     }
-    
+
     if ([attribute isEqualToString:@"AXTextMarkerRangeForUIElement"]) {
-        RefPtr<Range> range = uiElement.get()->elementRange();
-        return [self textMarkerRangeFromRange:range];
+        return Accessibility::retrieveValueFromMainThread<id>([&uiElement, protectedSelf = RetainPtr<WebAccessibilityObjectWrapper>(self)] () -> id {
+            RefPtr<Range> range = uiElement.get()->elementRange();
+            return [protectedSelf textMarkerRangeFromRange:range];
+        });
     }
-    
+
     if ([attribute isEqualToString:@"AXLineForTextMarker"]) {
         VisiblePosition visiblePos = [self visiblePositionForTextMarker:(textMarker)];
         return [NSNumber numberWithUnsignedInt:m_object->lineForPosition(visiblePos)];
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to