[webkit-changes] [WebKit/WebKit] 5ffe86: AX: Move AXTextMarkerRangeForUIElement off of the ...

AndresGonzalezApple noreply at github.com
Sat Apr 1 09:46:56 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5ffe861ef145de5ff0d61fdee973820ccd27bbfd
      https://github.com/WebKit/WebKit/commit/5ffe861ef145de5ff0d61fdee973820ccd27bbfd
  Author: Andres Gonzalez <andresg_22 at apple.com>
  Date:   2023-04-01 (Sat, 01 Apr 2023)

  Changed paths:
    M LayoutTests/accessibility/mac/character-offset-from-upstream-position-expected.txt
    M LayoutTests/accessibility/mac/character-offset-from-upstream-position.html
    M LayoutTests/accessibility/mac/character-offset-visible-position-conversion-with-emoji-expected.txt
    M LayoutTests/accessibility/mac/character-offset-visible-position-conversion-with-emoji.html
    M LayoutTests/accessibility/mac/listmarker-suffix-expected.txt
    M LayoutTests/accessibility/mac/listmarker-suffix.html
    M LayoutTests/accessibility/text-marker/text-marker-previous-next.html
    M Source/WebCore/accessibility/AXObjectCache.h
    M Source/WebCore/accessibility/AXTextMarker.cpp
    M Source/WebCore/accessibility/AXTextMarker.h
    M Source/WebCore/accessibility/cocoa/AXTextMarkerCocoa.mm
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp
    M Source/WebCore/accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm
    M Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm

  Log Message:
  -----------
  AX: Move AXTextMarkerRangeForUIElement off of the main thread for those objects caching AttributedStrings.
https://bugs.webkit.org/show_bug.cgi?id=254817
<rdar://problem/107473776>

Reviewed by Tyler Wilcock.

If an IsolatedObject has a cached AttributedString, this string represents the object and the TextMarkerRange for the object is now created as offsets into that string without having to hit the main thread. As a consequence,  the TextMarkers created this way will have no reference to DOM Nodes. To keep  these TextMarkers and TextMarkerRanges working in those functions where we still go to the main thread and rely on the Node references, we added the AXTextMarker::setNode method to set the Node reference in a TextMarker that clones one that was created on the AX thread.

Fixed AXTextMarker.simpleRange() by creating the BoundaryPoints from the CharacterOffsets instead of from the VisiblePositions.

All the API methods implemented in [WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:] that take a TextMarker or a TextMarkerRange as a parameter had to be modified accordingly.

Several tests were cleaned up and brought up to our current coding conventions.

Canonical link: https://commits.webkit.org/262480@main




More information about the webkit-changes mailing list