Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AX: Move attributedStringForNSRange off the main thread when possible.
https://bugs.webkit.org/show_bug.cgi?id=255789 <rdar://problem/108369924> Reviewed by Chris Fleizach. This patch avoids hitting the main thread for requests of the AttributedString for NSRanges contained in a text control. That is the most common case during text editing. To accomplish this, textMarkerRangeForNSRange needs to build a TextMarkerRange based on CharacterOffsets and not in VisiblePositions. In addition, the ranges used in caching the TextContent and the AttributedString also need to be based on CharacterOffsets. * Source/WebCore/accessibility/AXTextMarker.h: (WebCore::AXTextMarkerRange::operator bool const): Clean up. * Source/WebCore/accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::textContent const): * Source/WebCore/accessibility/cocoa/AccessibilityObjectCocoa.mm: (WebCore::AccessibilityObject::textMarkerRangeForNSRange const): * Source/WebCore/accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm: (WebCore::AXIsolatedObject::initializePlatformProperties): (WebCore::AXIsolatedObject::textMarkerRangeForNSRange const): (WebCore::AXIsolatedObject::attributedStringForTextMarkerRange const): (WebCore::AXIsolatedObject::cachedAttributedStringForTextMarkerRange const): Deleted. * Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h: * Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper attributedStringForNSRange:]): (-[WebAccessibilityObjectWrapper rtfForNSRange:]): (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]): (-[WebAccessibilityObjectWrapper doAXAttributedStringForRange:]): Renamed. (-[WebAccessibilityObjectWrapper doAXRTFForRange:]): Renamed. Canonical link: https://commits.webkit.org/263270@main
- Loading branch information
1 parent
465af8b
commit d910e37
Showing
6 changed files
with
48 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters