Changeset 285872 in webkit
- Timestamp:
- Nov 16, 2021, 10:14:09 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp (modified) (2 diffs)
-
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (modified) (2 diffs)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r285867 r285872 1 2021-11-16 Andres Gonzalez <andresg_22@apple.com> 2 3 Fix for accessibility/mac/replace-text-with-range-on-webarea-element.html in isolated tree mode. 4 https://bugs.webkit.org/show_bug.cgi?id=233160 5 <rdar://problem/85436385> 6 7 Reviewed by Chris Fleizach. 8 9 Test: accessibility/mac/replace-text-with-range-on-webarea-element.html 10 11 The replacement and insertion text string is now properly isolatedCopied 12 in the AXIsolatedObject method instead of in the wrapper. 13 14 * accessibility/isolatedtree/AXIsolatedObject.cpp: 15 (WebCore::AXIsolatedObject::replaceTextInRange): 16 (WebCore::AXIsolatedObject::insertText): 17 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: 18 (-[WebAccessibilityObjectWrapper accessibilityReplaceRange:withText:]): 19 (-[WebAccessibilityObjectWrapper accessibilityInsertText:]): 20 1 21 2021-11-16 Youenn Fablet <youenn@apple.com> 2 22 -
trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp
r285589 r285872 1197 1197 bool AXIsolatedObject::replaceTextInRange(const String& replacementText, const PlainTextRange& textRange) 1198 1198 { 1199 return Accessibility::retrieveValueFromMainThread<bool>([ &replacementText, &textRange, this] () -> bool {1199 return Accessibility::retrieveValueFromMainThread<bool>([text = replacementText.isolatedCopy(), &textRange, this] () -> bool { 1200 1200 if (auto* axObject = associatedAXObject()) 1201 return axObject->replaceTextInRange( replacementText, textRange);1201 return axObject->replaceTextInRange(text, textRange); 1202 1202 return false; 1203 1203 }); … … 1206 1206 bool AXIsolatedObject::insertText(const String& text) 1207 1207 { 1208 return Accessibility::retrieveValueFromMainThread<bool>([ &text, this] () -> bool {1208 return Accessibility::retrieveValueFromMainThread<bool>([text = text.isolatedCopy(), this] () -> bool { 1209 1209 if (auto* axObject = associatedAXObject()) 1210 1210 return axObject->insertText(text); -
trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
r285589 r285872 3278 3278 { 3279 3279 auto* backingObject = self.updateObjectBackingStore; 3280 if (!backingObject) 3281 return NO; 3282 3283 return backingObject->replaceTextInRange(String(string).isolatedCopy(), PlainTextRange(range)); 3280 return backingObject ? backingObject->replaceTextInRange(String(string), PlainTextRange(range)) : NO; 3284 3281 } 3285 3282 … … 3287 3284 { 3288 3285 auto* backingObject = self.updateObjectBackingStore; 3289 if (!backingObject) 3290 return NO; 3291 3292 return backingObject->insertText(String(text).isolatedCopy()); 3286 return backingObject ? backingObject->insertText(String(text)) : NO; 3293 3287 } 3294 3288 -
trunk/Tools/ChangeLog
r285870 r285872 1 2021-11-16 Andres Gonzalez <andresg_22@apple.com> 2 3 Fix for accessibility/mac/replace-text-with-range-on-webarea-element.html in isolated tree mode. 4 https://bugs.webkit.org/show_bug.cgi?id=233160 5 <rdar://problem/85436385> 6 7 Reviewed by Chris Fleizach. 8 9 * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm: 10 (WTR::AccessibilityUIElement::stringValue): 11 (WTR::AccessibilityUIElement::replaceTextInRange): 12 Dispatches to the AX thread the call to the wrapper's 13 [accessibilityReplaceRange withText:] method. 14 1 15 2021-11-16 Brady Eidson <beidson@apple.com> 2 16 -
trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm
r285859 r285872 767 767 { 768 768 BEGIN_AX_OBJC_EXCEPTIONS 769 NSString *description = descriptionOfValue(attributeValue(NSAccessibilityValueAttribute).get()); 769 auto value = attributeValue(NSAccessibilityValueAttribute); 770 NSString *description = descriptionOfValue(value.get()); 770 771 if (description) 771 772 return concatenateAttributeAndValue(@"AXValue", description); … … 2031 2032 bool AccessibilityUIElement::replaceTextInRange(JSStringRef string, int location, int length) 2032 2033 { 2033 BEGIN_AX_OBJC_EXCEPTIONS 2034 return [m_element accessibilityReplaceRange:NSMakeRange(location, length) withText:[NSString stringWithJSStringRef:string]]; 2035 END_AX_OBJC_EXCEPTIONS 2036 return false; 2034 bool result = false; 2035 2036 BEGIN_AX_OBJC_EXCEPTIONS 2037 AccessibilityUIElement::s_controller->executeOnAXThreadAndWait([text = [NSString stringWithJSStringRef:string], range = NSMakeRange(location, length), this, &result] { 2038 result = [m_element accessibilityReplaceRange:range withText:text]; 2039 }); 2040 END_AX_OBJC_EXCEPTIONS 2041 2042 return result; 2037 2043 } 2038 2044
Note:
See TracChangeset
for help on using the changeset viewer.