Isolated object implementation of parameterized attribute SelectTextWithCriteria.
authorandresg_22@apple.com <andresg_22@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Dec 2019 18:47:54 +0000 (18:47 +0000)
committerandresg_22@apple.com <andresg_22@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Dec 2019 18:47:54 +0000 (18:47 +0000)
commit48628ffa264622485bf7017f96ec40860e9a06bb
treecc72e7e6e97a85378cd7c20a0c956c2ce6be4379
parent3e45c3cafeaad6ba8f68cd463663a622317bd173
Isolated object implementation of parameterized attribute SelectTextWithCriteria.
https://bugs.webkit.org/show_bug.cgi?id=205210

Reviewed by Chris Fleizach.

Source/WebCore:

LayoutTests/accessibility/mac/find-and-replace-match-capitalization.html exercise this functionality.

Requests for parameterized attributes that require computations in
the WebCore DOM need to be dispatched to the main thread. This
change is the blueprint for all other attributes to follow.

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::isolatedTreeRootObject): The isolated tree root object is always retrieved in the main thread.
(WebCore::AXObjectCache::generateIsolatedTree): Sets the AXObjectCache for the generated IsolatedTree.
* accessibility/AccessibilityObjectInterface.h: Added the template functions to dispatch to the main thread.
(WebCore::Accessibility::performFunctionOnMainThread):
(WebCore::Accessibility::retrieveValueFromMainThread):
* accessibility/AccessibilityRenderObject.cpp: Removed obsolete asserts.
(WebCore::AccessibilityRenderObject::visibleChildren):
(WebCore::AccessibilityRenderObject::tabChildren):
* accessibility/isolatedtree/AXIsolatedTree.h: It now holds a reference to the AXObjectCache.
(WebCore::AXIsolatedTree::axObjectCache const):
(WebCore::AXIsolatedTree::setAXObjectCache):
* accessibility/isolatedtree/AXIsolatedTreeNode.cpp:
(WebCore::AXIsolatedObject::findTextRanges const):
(WebCore::AXIsolatedObject::performTextOperation):
(WebCore::AXIsolatedObject::axObjectCache const):
* accessibility/isolatedtree/AXIsolatedTreeNode.h:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm: Moved template functions to dispatch to the main thread into the Accessibility namespace to use them in the isolated object implementation.
(-[WebAccessibilityObjectWrapper attachmentView]):
(-[WebAccessibilityObjectWrapper renderWidgetChildren]):
(-[WebAccessibilityObjectWrapper associatedPluginParent]):
(-[WebAccessibilityObjectWrapper scrollViewParent]):
(-[WebAccessibilityObjectWrapper windowElement:]):
(-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
(performAccessibilityFunctionOnMainThread): Moved.
(retrieveAccessibilityValueFromMainThread): Moved.

Tools:

* WebKitTestRunner/InjectedBundle/AccessibilityController.cpp:
(WTR::AccessibilityController::rootElement): Always run in my thread.
(WTR::AccessibilityController::execute): Dispatches to the secondary thread. Spins the main loop to allow parameterized attributes methods to execute in main thread.
* WebKitTestRunner/InjectedBundle/mac/AccessibilityControllerMac.mm:
(WTR::findAccessibleObjectById):
(WTR::AccessibilityController::accessibleElementById):
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::AccessibilityUIElement::selectTextWithCriteria):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@253565 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AXObjectCache.cpp
Source/WebCore/accessibility/AccessibilityObjectInterface.h
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h
Source/WebCore/accessibility/isolatedtree/AXIsolatedTreeNode.cpp
Source/WebCore/accessibility/isolatedtree/AXIsolatedTreeNode.h
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp
Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.h
Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityControllerMac.mm
Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm