[webkit-changes] [WebKit/WebKit] b2047f: AX: Implement off-main thread versions of NextWord...

Joshua Hoffman noreply at github.com
Mon Feb 3 17:32:56 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b2047fa58d86cb7ebdad3454fd27f998c837b096
      https://github.com/WebKit/WebKit/commit/b2047fa58d86cb7ebdad3454fd27f998c837b096
  Author: Joshua Hoffman <jhoffman23 at apple.com>
  Date:   2025-02-03 (Mon, 03 Feb 2025)

  Changed paths:
    M LayoutTests/TestExpectations
    M LayoutTests/accessibility-isolated-tree/TestExpectations
    A LayoutTests/accessibility/isolated-tree/editable-word-navigation-expected.txt
    A LayoutTests/accessibility/isolated-tree/editable-word-navigation.html
    A LayoutTests/accessibility/isolated-tree/simple-word-navigation-expected.txt
    A LayoutTests/accessibility/isolated-tree/simple-word-navigation.html
    M Source/WebCore/accessibility/AXTextMarker.cpp
    M Source/WebCore/accessibility/AXTextMarker.h
    M Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm

  Log Message:
  -----------
  AX: Implement off-main thread versions of NextWordEnd, PreviousWordStart, LeftWord, and RightWord APIs
https://bugs.webkit.org/show_bug.cgi?id=286832
rdar://143986260

Reviewed by Tyler Wilcock.

This PR re-implements the LeftWord and RightWord APIs off the main thread, as well as simplifies
our word navigation (previousWordStart, nextWordEnd) APIs.

Our previous go at doing LeftWord and RightWord made it challenging to implement
PreviousWordStart and NextWordEnd, since the former APIs are in essence a subset of the latter.

This new implemenation creates a new baseline expectation for what these APIs should return,
illustrated in the new simple-word-navigation.html and editable-word-navigation tests.

- Previous word start: the previous start word boundary, not including the current position
(unless at the start of a containing block, which would return the current position).
- Next word end: the next end word boundary, not including the current position
(unless at the end of a containing block, which would return the current position).
- Right/Left word: The full word *immediately* to the right/left of a text marker. If you are
in a word, this is that word range.

* LayoutTests/TestExpectations:
* LayoutTests/accessibility-isolated-tree/TestExpectations:
* LayoutTests/accessibility/isolated-tree/editable-word-navigation-expected.txt: Added.
* LayoutTests/accessibility/isolated-tree/editable-word-navigation.html: Added.
* LayoutTests/accessibility/isolated-tree/simple-word-navigation-expected.txt: Added.
* LayoutTests/accessibility/isolated-tree/simple-word-navigation.html: Added.
* Source/WebCore/accessibility/AXTextMarker.cpp:
(WebCore::AXTextMarker::findWordOrSentence const):
(WebCore::AXTextMarker::wordRange const):
* Source/WebCore/accessibility/AXTextMarker.h:
* Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper textMarkerRangeAtTextMarker:forUnit:]):
(-[WebAccessibilityObjectWrapper textMarkerForTextMarker:atUnit:]):

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



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list