Source/JavaScriptCore:
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 27 Jan 2019 08:49:29 +0000 (08:49 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 27 Jan 2019 08:49:29 +0000 (08:49 +0000)
commit397b367cb75fd4992d3c5ea160447353ff31df30
tree9fed8e41aa601f9dbbd56163c1a4a04ef5025b53
parent9481976847e346001a445b67b288d0a43609419b
Source/JavaScriptCore:
AX: Introduce a static accessibility tree
https://bugs.webkit.org/show_bug.cgi?id=193348
<rdar://problem/47203295>

Reviewed by Ryosuke Niwa.

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:
AX: Introduce a static accessibility tree
https://bugs.webkit.org/show_bug.cgi?id=193348
<rdar://problem/47203295>

Reviewed by Ryosuke Niwa.

In order to improve performance when requesting the accessibility hierarchy, we introduce the idea of a "static accessibility tree" which
could be accessed on a different thread by assistive technologies.
That is accomplished by storing all the data needed to answer accessibility attribute queries in a static object that mirrors the
"live" AccessibilityObjects (which interact with both DOM and Render trees).
These static objects are generally created after layout is done and final tasks are being performed. They are then stored in the static tree
representation and able to be read from anywhere.
Tactically this is done with AXIsolatedTreeNodes inside of an AXIsolatedTree. The TreeNodes implement an AccessibilityObjectInterface shared
with AccessibilityObject.
This allows the wrappers to access either one depending on conditions and platforms without significant code duplication or re-organization.

* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::remove):
(WebCore::AXObjectCache::createIsolatedAccessibilityTree):
(WebCore::AXObjectCache::generateStaticAccessibilityTreeIfNeeded):
* accessibility/AXObjectCache.h:
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityObjectInterface.h: Added.
* accessibility/isolatedtree: Added.
* accessibility/isolatedtree/AXIsolatedTree.cpp: Added.
(WebCore::AXIsolatedTree::treeCache):
(WebCore::AXIsolatedTree::AXIsolatedTree):
(WebCore::AXIsolatedTree::create):
(WebCore::AXIsolatedTree::treeForID):
(WebCore::AXIsolatedTree::treeForPageID):
(WebCore::AXIsolatedTree::nodeForID const):
(WebCore::AXIsolatedTree::rootNode):
(WebCore::AXIsolatedTree::removeNode):
(WebCore::AXIsolatedTree::appendNodeChanges):
(WebCore::AXIsolatedTree::applyPendingChanges):
* accessibility/isolatedtree/AXIsolatedTree.h: Added.
(WebCore::AXIsolatedTree::treeIdentifier const):
* accessibility/isolatedtree/AXIsolatedTreeNode.cpp: Added.
    To note: we don't mark the attribute map const because even though attributes don't change after initial creation,
    we may copy an existing node and replace specific values.
(WebCore::AXIsolatedTreeNode::AXIsolatedTreeNode):
(WebCore::AXIsolatedTreeNode::create):
(WebCore::AXIsolatedTreeNode::initializeAttributeData):
(WebCore::AXIsolatedTreeNode::setProperty):
(WebCore::AXIsolatedTreeNode::doubleAttributeValue const):
(WebCore::AXIsolatedTreeNode::unsignedAttributeValue const):
(WebCore::AXIsolatedTreeNode::boolAttributeValue const):
(WebCore::AXIsolatedTreeNode::stringAttributeValue const):
(WebCore::AXIsolatedTreeNode::intAttributeValue const):
* accessibility/isolatedtree/AXIsolatedTreeNode.h: Added.
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::associateIsolatedTreeNode):
* accessibility/mac/WebAccessibilityObjectWrapperBase.h:
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(-[WebAccessibilityObjectWrapperBase initWithAccessibilityObject:]):
(-[WebAccessibilityObjectWrapperBase isolatedTreeNode]):
(-[WebAccessibilityObjectWrapperBase detach]):
(-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):
(-[WebAccessibilityObjectWrapperBase axBackingObject]):
(-[WebAccessibilityObjectWrapperBase baseAccessibilityDescription]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper role]):
(-[WebAccessibilityObjectWrapper subrole]):
(-[WebAccessibilityObjectWrapper roleDescription]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
* dom/Document.cpp:
(WebCore::Document::pageID const):
* dom/Document.h:

Source/WebCore/PAL:
AX: Introduce isolated accessibility tree
https://bugs.webkit.org/show_bug.cgi?id=193348
<rdar://problem/47203295>

Reviewed by Ryosuke Niwa.

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:
AX: Introduce a static accessibility tree
https://bugs.webkit.org/show_bug.cgi?id=193348
<rdar://problem/47203295>

Reviewed by Ryosuke Niwa.

* Configurations/FeatureDefines.xcconfig:
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
(-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):

Source/WebKitLegacy/mac:
AX: Introduce a static accessibility tree
https://bugs.webkit.org/show_bug.cgi?id=193348
<rdar://problem/47203295>

Reviewed by Ryosuke Niwa.

* Configurations/FeatureDefines.xcconfig:

Tools:
AX: Introduce a static accessibility tree
https://bugs.webkit.org/show_bug.cgi?id=193348
<rdar://problem/47203295>

Reviewed by Ryosuke Niwa.

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240552 268f45cc-cd09-0410-ab3c-d52691b4dbfc
32 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/Configurations/FeatureDefines.xcconfig
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/Configurations/FeatureDefines.xcconfig
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/accessibility/AXObjectCache.cpp
Source/WebCore/accessibility/AXObjectCache.h
Source/WebCore/accessibility/AccessibilityObject.h
Source/WebCore/accessibility/AccessibilityObjectInterface.h [new file with mode: 0644]
Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp [new file with mode: 0644]
Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h [new file with mode: 0644]
Source/WebCore/accessibility/isolatedtree/AXIsolatedTreeNode.cpp [new file with mode: 0644]
Source/WebCore/accessibility/isolatedtree/AXIsolatedTreeNode.h [new file with mode: 0644]
Source/WebCore/accessibility/mac/AXObjectCacheMac.mm
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.h
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebKit/ChangeLog
Source/WebKit/Configurations/FeatureDefines.xcconfig
Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.h
Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/Configurations/FeatureDefines.xcconfig
Source/cmake/WebKitFeatures.cmake
Tools/ChangeLog
Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig