Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a1746d78059d34a48dbe6ac54f4e0487d1259772
      
https://github.com/WebKit/WebKit/commit/a1746d78059d34a48dbe6ac54f4e0487d1259772
  Author: Joshua Hoffman <[email protected]>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M 
LayoutTests/accessibility/mac/doctype-node-in-text-marker-crash-expected.txt
    M LayoutTests/accessibility/mac/doctype-node-in-text-marker-crash.html
    M LayoutTests/accessibility/mac/replace-text-with-range-expected.txt
    M 
LayoutTests/accessibility/mac/replace-text-with-range-value-change-notification.html
    M LayoutTests/accessibility/mac/replace-text-with-range.html
    M LayoutTests/accessibility/mac/text-marker-p-tags-expected.txt
    M LayoutTests/accessibility/mac/text-marker-p-tags.html
    M Source/WebCore/accessibility/AXCoreObject.h
    M Source/WebCore/accessibility/AXObjectCache.cpp
    M Source/WebCore/accessibility/AXObjectCache.h
    M Source/WebCore/accessibility/AccessibilityObject.cpp
    M Source/WebCore/accessibility/AccessibilityObject.h
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h
    M Source/WebCore/accessibility/mac/AXObjectCacheMac.mm
    M Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm

  Log Message:
  -----------
  AX: Move AXSelectedTextMarkerRange off of the main thread
https://bugs.webkit.org/show_bug.cgi?id=262433
rdar://116128660

Reviewed by Chris Fleizach.

This patch moves the AXSelectedTextMarkerRange attribute off of the main thread 
in
isolated tree mode, by caching the relevant text marker data.

When selection changes on the web, the AXObjectCache is notified through a call 
to
postTextStateChangeNotification from 
FrameSelection::notifyAccessibilityForSelectionChange.
>From there, a new method, onSelectedTextChanged, handles updating the isolated 
>tree's
m_selectedTextMarkerRange with the relevant text markers for the start and end 
of the
selection. These are stored in a pair of TextMarkerData structs.

An important piece of this is that we need the nodes of the start and end text 
markers
to exist in the isolated tree. So, if one or both of these nodes are ignored, 
they are added
to the isolated tree as unconnected nodes. This is handled in 
onSelectedTextChanged.

Finally, when the range is requested via 
AXIsolatedObject::selectedTextMarkerRange(),
an AXTextMarkerRange is constructed from the cached TextMarkerData pair.

This patch also modifies previous tests to make them asynchronous for this new 
behavior.

* LayoutTests/accessibility/mac/doctype-node-in-text-marker-crash-expected.txt:
* LayoutTests/accessibility/mac/doctype-node-in-text-marker-crash.html:
* LayoutTests/accessibility/mac/replace-text-with-range-expected.txt:
* 
LayoutTests/accessibility/mac/replace-text-with-range-value-change-notification.html:
* LayoutTests/accessibility/mac/replace-text-with-range.html:
* LayoutTests/accessibility/mac/text-marker-p-tags-expected.txt:
* LayoutTests/accessibility/mac/text-marker-p-tags.html:
* Source/WebCore/accessibility/AXCoreObject.h:
* Source/WebCore/accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::postTextStateChangeNotification):
* Source/WebCore/accessibility/AXObjectCache.h:
* Source/WebCore/accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::selectedTextMarkerRange):
* Source/WebCore/accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::selectedVisiblePositionRange const):
* Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::selectedTextMarkerRange):
(WebCore::AXIsolatedObject::selectedVisiblePositionRange const): Deleted.
* Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h:
* Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp:
* Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h:
(WebCore::AXIsolatedTree::selectedTextMarkerRange):
(WebCore::AXIsolatedTree::setSelectedTextMarkerRange):
* Source/WebCore/accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::onSelectedTextChanged):
* Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper selectedTextMarkerRange]):

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


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to