[webkit-changes] [WebKit/WebKit] dbf115: AX: add Mac API to get the intersection between th...

Commit Queue noreply at github.com
Wed Dec 6 11:25:50 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: dbf11589ce2fd7f92fdfa461010f6d3ff5719f4f
      https://github.com/WebKit/WebKit/commit/dbf11589ce2fd7f92fdfa461010f6d3ff5719f4f
  Author: Dominic Mazzoni <dmazzoni at google.com>
  Date:   2023-12-06 (Wed, 06 Dec 2023)

  Changed paths:
    M LayoutTests/accessibility/mac/bounds-for-range-expected.txt
    M LayoutTests/accessibility/mac/internal-link-anchors-expected.txt
    A LayoutTests/accessibility/mac/intersection-with-selection-range-expected.txt
    A LayoutTests/accessibility/mac/intersection-with-selection-range.html
    M LayoutTests/platform/mac-wk1/TestExpectations
    M Source/WebCore/accessibility/AXTextMarker.cpp
    M Source/WebCore/accessibility/AXTextMarker.h
    M Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
    M Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h
    M Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl
    M Tools/WebKitTestRunner/InjectedBundle/atspi/AccessibilityUIElementAtspi.cpp
    M Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm
    M Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm
    M Tools/WebKitTestRunner/InjectedBundle/win/AccessibilityUIElementWin.cpp

  Log Message:
  -----------
  AX: add Mac API to get the intersection between the selected text range and an element

https://bugs.webkit.org/show_bug.cgi?id=265683
rdar://119054143

Reviewed by Andres Gonzalez.

One of the things preventing VoiceOver from being able to use WebKit
entirely off the main thread is that it wants to be able to access the
range of a static text element that's part of the document selection,
if any.

Doing that using text ranges is complex and hard for WebKit to
optimize. A new API that provides this information directly can be
computed efficiently using the isolated tree.

This patch implements this using a new method to compute the intersection
of two AXTextMarkerRanges. It's efficient when both ranges span a single
element each (either both in the same element, or both different elements),
and it falls back to the main thread if not.

* LayoutTests/accessibility/mac/bounds-for-range-expected.txt:
* LayoutTests/accessibility/mac/internal-link-anchors-expected.txt:
* LayoutTests/accessibility/mac/intersection-with-selection-range-expected.txt: Added.
* LayoutTests/accessibility/mac/intersection-with-selection-range.html: Added.
* LayoutTests/platform/mac-wk1/TestExpectations:
* Source/WebCore/accessibility/AXTextMarker.cpp:
(WebCore::AXTextMarkerRange::intersectionWith const):
* Source/WebCore/accessibility/AXTextMarker.h:
* Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
(-[WebAccessibilityObjectWrapper intersectionWithSelectionRange]):
* Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
* Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
* Tools/WebKitTestRunner/InjectedBundle/atspi/AccessibilityUIElementAtspi.cpp:
(WTR::AccessibilityUIElement::intersectionWithSelectionRange):
* Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(WTR::AccessibilityUIElement::intersectionWithSelectionRange):
* Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::AccessibilityUIElement::isIsolatedObject const):
(WTR::AccessibilityUIElement::selectedTextRange):
(WTR::AccessibilityUIElement::intersectionWithSelectionRange):
* Tools/WebKitTestRunner/InjectedBundle/win/AccessibilityUIElementWin.cpp:
(WTR::AccessibilityUIElement::intersectionWithSelectionRange):

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




More information about the webkit-changes mailing list