[webkit-changes] [WebKit/WebKit] 57e3f9: AX: Implement TextUnit::Sentence (current) off the...

Joshua Hoffman noreply at github.com
Wed Oct 9 21:51:09 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 57e3f9bf4e22d7ff0ba3f08344782a277fbeca38
      https://github.com/WebKit/WebKit/commit/57e3f9bf4e22d7ff0ba3f08344782a277fbeca38
  Author: Joshua Hoffman <jhoffman23 at apple.com>
  Date:   2024-10-09 (Wed, 09 Oct 2024)

  Changed paths:
    A LayoutTests/accessibility/ax-thread-text-apis/text-marker-sentence-nav-expected.txt
    A LayoutTests/accessibility/ax-thread-text-apis/text-marker-sentence-nav.html
    M Source/WebCore/accessibility/AXTextMarker.cpp
    M Source/WebCore/accessibility/AXTextMarker.h
    M Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm

  Log Message:
  -----------
  AX: Implement TextUnit::Sentence (current) off the main thread
https://bugs.webkit.org/show_bug.cgi?id=281182
rdar://134579696

Reviewed by Tyler Wilcock.

This patch supports calculating the current TextUnit::Sentence on the accessibility thread. Building
off of the work done for supporting LeftWord/RightWord, I reuse that existing infrastructure, and
abstract out the calculations for word and sentence text units into lambdas.

The partially ported test, text-marker-sentence-nav.html, only verifies the current-sentence API.
This test will be expanded once more Sentence APIs are implemented on the accessibility thread
(see "FIXME"s in the test).

* LayoutTests/accessibility/ax-thread-text-apis/text-marker-sentence-nav-expected.txt: Added.
* LayoutTests/accessibility/ax-thread-text-apis/text-marker-sentence-nav.html: Added.
* Source/WebCore/accessibility/AXTextMarker.cpp:
(WebCore::previousSentenceStartFromPosition):
(WebCore::nextSentenceEndFromPosition):
(WebCore::AXTextMarker::findMarker const):
(WebCore::AXTextMarker::sentenceRange const):
* Source/WebCore/accessibility/AXTextMarker.h:
(WebCore::AXTextMarker::previousSentenceStart const):
(WebCore::AXTextMarker::nextSentenceEnd const):
* Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper textMarkerRangeAtTextMarker:forUnit:]):

Canonical link: https://commits.webkit.org/284951@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