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)
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

index 64b553e..ac6f664 100644 (file)
@@ -1,3 +1,13 @@
+2019-01-27  Chris Fleizach  <cfleizach@apple.com>
+
+        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:
+
 2019-01-26  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: provide a way to edit the user agent of a remote target
index 9122a25..230623e 100644 (file)
@@ -40,6 +40,8 @@ ENABLE_ACCELERATED_2D_CANVAS = ;
 ENABLE_ACCELERATED_OVERFLOW_SCROLLING = $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING_$(WK_COCOA_TOUCH));
 ENABLE_ACCELERATED_OVERFLOW_SCROLLING_cocoatouch = ENABLE_ACCELERATED_OVERFLOW_SCROLLING;
 
+ENABLE_ACCESSIBILITY_ISOLATED_TREE = ;
+
 ENABLE_APPLE_PAY = $(ENABLE_APPLE_PAY_$(WK_PLATFORM_NAME));
 ENABLE_APPLE_PAY_iphoneos = ENABLE_APPLE_PAY;
 ENABLE_APPLE_PAY_iphonesimulator = ENABLE_APPLE_PAY;
@@ -407,4 +409,4 @@ ENABLE_WIRELESS_PLAYBACK_TARGET = ENABLE_WIRELESS_PLAYBACK_TARGET;
 
 ENABLE_XSLT = ENABLE_XSLT;
 
-FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_C_LOOP) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FTL_JIT) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_EVENTS) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_WEB_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_USERSELECT_ALL) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_RTC) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBASSEMBLY_STREAMING_API) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEBMETAL) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_ACCESSIBILITY_ISOLATED_TREE) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_C_LOOP) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FTL_JIT) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_EVENTS) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_WEB_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_USERSELECT_ALL) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_RTC) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBASSEMBLY_STREAMING_API) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEBMETAL) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
index 0de5943..482cf6f 100644 (file)
@@ -58,6 +58,7 @@ set(WebCore_INCLUDE_DIRECTORIES
     "${WEBCORE_DIR}/Modules/websockets"
     "${WEBCORE_DIR}/Modules/webvr"
     "${WEBCORE_DIR}/accessibility"
+    "${WEBCORE_DIR}/accessibility/isolatedtree"
     "${WEBCORE_DIR}/animation"
     "${WEBCORE_DIR}/bindings"
     "${WEBCORE_DIR}/bindings/js"
index aaa1139..8a65aa4 100644 (file)
@@ -1,3 +1,78 @@
+2019-01-27  Chris Fleizach  <cfleizach@apple.com>
+
+        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:
+
 2019-01-26  Simon Fraser  <simon.fraser@apple.com>
 
         Allow scrolling tree nodes to exist in a detached state
index 9122a25..230623e 100644 (file)
@@ -40,6 +40,8 @@ ENABLE_ACCELERATED_2D_CANVAS = ;
 ENABLE_ACCELERATED_OVERFLOW_SCROLLING = $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING_$(WK_COCOA_TOUCH));
 ENABLE_ACCELERATED_OVERFLOW_SCROLLING_cocoatouch = ENABLE_ACCELERATED_OVERFLOW_SCROLLING;
 
+ENABLE_ACCESSIBILITY_ISOLATED_TREE = ;
+
 ENABLE_APPLE_PAY = $(ENABLE_APPLE_PAY_$(WK_PLATFORM_NAME));
 ENABLE_APPLE_PAY_iphoneos = ENABLE_APPLE_PAY;
 ENABLE_APPLE_PAY_iphonesimulator = ENABLE_APPLE_PAY;
@@ -407,4 +409,4 @@ ENABLE_WIRELESS_PLAYBACK_TARGET = ENABLE_WIRELESS_PLAYBACK_TARGET;
 
 ENABLE_XSLT = ENABLE_XSLT;
 
-FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_C_LOOP) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FTL_JIT) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_EVENTS) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_WEB_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_USERSELECT_ALL) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_RTC) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBASSEMBLY_STREAMING_API) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEBMETAL) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_ACCESSIBILITY_ISOLATED_TREE) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_C_LOOP) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FTL_JIT) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_EVENTS) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_WEB_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_USERSELECT_ALL) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_RTC) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBASSEMBLY_STREAMING_API) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEBMETAL) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
index cd4dc6c..83c5c26 100644 (file)
@@ -1,3 +1,13 @@
+2019-01-27  Chris Fleizach  <cfleizach@apple.com>
+
+        AX: Introduce isolated accessibility tree
+        https://bugs.webkit.org/show_bug.cgi?id=193348
+        <rdar://problem/47203295>
+
+        Reviewed by Ryosuke Niwa.
+
+        * Configurations/FeatureDefines.xcconfig:
+
 2019-01-25  Alex Christensen  <achristensen@webkit.org>
 
         Move logic from ChildProcess::setApplicationIsDaemon to NetworkProcess::initializeProcess
index 9122a25..230623e 100644 (file)
@@ -40,6 +40,8 @@ ENABLE_ACCELERATED_2D_CANVAS = ;
 ENABLE_ACCELERATED_OVERFLOW_SCROLLING = $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING_$(WK_COCOA_TOUCH));
 ENABLE_ACCELERATED_OVERFLOW_SCROLLING_cocoatouch = ENABLE_ACCELERATED_OVERFLOW_SCROLLING;
 
+ENABLE_ACCESSIBILITY_ISOLATED_TREE = ;
+
 ENABLE_APPLE_PAY = $(ENABLE_APPLE_PAY_$(WK_PLATFORM_NAME));
 ENABLE_APPLE_PAY_iphoneos = ENABLE_APPLE_PAY;
 ENABLE_APPLE_PAY_iphonesimulator = ENABLE_APPLE_PAY;
@@ -407,4 +409,4 @@ ENABLE_WIRELESS_PLAYBACK_TARGET = ENABLE_WIRELESS_PLAYBACK_TARGET;
 
 ENABLE_XSLT = ENABLE_XSLT;
 
-FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_C_LOOP) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FTL_JIT) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_EVENTS) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_WEB_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_USERSELECT_ALL) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_RTC) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBASSEMBLY_STREAMING_API) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEBMETAL) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_ACCESSIBILITY_ISOLATED_TREE) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_C_LOOP) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FTL_JIT) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_EVENTS) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_WEB_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_USERSELECT_ALL) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_RTC) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBASSEMBLY_STREAMING_API) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEBMETAL) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
index e49d19c..de5421f 100644 (file)
@@ -405,6 +405,8 @@ accessibility/AccessibilityTableRow.cpp
 accessibility/AccessibilityTree.cpp
 accessibility/AccessibilityTreeItem.cpp
 accessibility/AccessibleSetValueEvent.cpp
+accessibility/isolatedtree/AXIsolatedTree.cpp
+accessibility/isolatedtree/AXIsolatedTreeNode.cpp
 
 animation/AnimationEffect.cpp
 animation/AnimationPlaybackEvent.cpp
index 990dcda..7ed125d 100644 (file)
                26F9A83818A046AC00AEB88A /* ViewportConfiguration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F9A83618A046AC00AEB88A /* ViewportConfiguration.cpp */; };
                26F9A83918A046AC00AEB88A /* ViewportConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 26F9A83718A046AC00AEB88A /* ViewportConfiguration.h */; settings = {ATTRIBUTES = (Private, ); }; };
                2914E3081CAB5A440049966F /* AccessibilityAttachment.h in Headers */ = {isa = PBXBuildFile; fileRef = 2914E3061CAB5A440049966F /* AccessibilityAttachment.h */; };
+               2936BF5C21D69E4B004A8FC9 /* AccessibilityObjectInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 2936BF5A21D6999E004A8FC9 /* AccessibilityObjectInterface.h */; settings = {ATTRIBUTES = (Private, ); }; };
                293EAE1F1356B2FE0067ACF9 /* RuntimeApplicationChecks.h in Headers */ = {isa = PBXBuildFile; fileRef = 293EAE1E1356B2FE0067ACF9 /* RuntimeApplicationChecks.h */; settings = {ATTRIBUTES = (Private, ); }; };
                29489FC712C00F0300D83F0F /* AccessibilityScrollView.h in Headers */ = {isa = PBXBuildFile; fileRef = 29489FC512C00F0300D83F0F /* AccessibilityScrollView.h */; };
                297BE3D516C03C08003316BD /* PlatformSpeechSynthesisUtterance.h in Headers */ = {isa = PBXBuildFile; fileRef = 2527CC9116BF8BA1009DDAC0 /* PlatformSpeechSynthesisUtterance.h */; };
                29A812430FBB9C1D00510293 /* AccessibilityListBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 29A812250FBB9C1D00510293 /* AccessibilityListBox.h */; };
                29A812490FBB9CA900510293 /* WebAccessibilityObjectWrapperBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 29A812450FBB9CA900510293 /* WebAccessibilityObjectWrapperBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
                29ACB212143E7128006BCA5F /* AccessibilityMockObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 29ACB211143E7128006BCA5F /* AccessibilityMockObject.h */; };
+               29AE212D21AB9EEB00869283 /* AXIsolatedTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 29AE212B21AB9EEB00869283 /* AXIsolatedTree.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               29AE213521ABA48A00869283 /* AXIsolatedTreeNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 29AE213321ABA48A00869283 /* AXIsolatedTreeNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
                29D7BCFA1444AF7D0070619C /* AccessibilitySpinButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 29D7BCF91444AF7D0070619C /* AccessibilitySpinButton.h */; };
                29FAF4B6195AB08900A522DC /* TextUndoInsertionMarkupMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 29FAF4B5195AB08900A522DC /* TextUndoInsertionMarkupMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
                2B365C841525119E0091D27B /* RenderSVGEllipse.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B4235A015250F6000DBBCD8 /* RenderSVGEllipse.h */; };
                28DB9BC72020EA0400E54A07 /* PerformanceServerTiming.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PerformanceServerTiming.idl; sourceTree = "<group>"; };
                2914E3051CAB5A440049966F /* AccessibilityAttachment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityAttachment.cpp; sourceTree = "<group>"; };
                2914E3061CAB5A440049966F /* AccessibilityAttachment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityAttachment.h; sourceTree = "<group>"; };
+               2936BF5A21D6999E004A8FC9 /* AccessibilityObjectInterface.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AccessibilityObjectInterface.h; sourceTree = "<group>"; };
                293EAE1E1356B2FE0067ACF9 /* RuntimeApplicationChecks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RuntimeApplicationChecks.h; sourceTree = "<group>"; };
                29489FC512C00F0300D83F0F /* AccessibilityScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityScrollView.h; sourceTree = "<group>"; };
                29498681195341940072D2BD /* TextUndoInsertionMarkupMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TextUndoInsertionMarkupMac.mm; sourceTree = "<group>"; };
                29A812470FBB9CA900510293 /* AXObjectCacheMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AXObjectCacheMac.mm; sourceTree = "<group>"; };
                29ACB211143E7128006BCA5F /* AccessibilityMockObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityMockObject.h; sourceTree = "<group>"; };
                29ACB213143E7498006BCA5F /* AccessibilityMockObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityMockObject.cpp; sourceTree = "<group>"; };
+               29AE212B21AB9EEB00869283 /* AXIsolatedTree.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AXIsolatedTree.h; sourceTree = "<group>"; };
+               29AE212C21AB9EEB00869283 /* AXIsolatedTree.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AXIsolatedTree.cpp; sourceTree = "<group>"; };
+               29AE213321ABA48A00869283 /* AXIsolatedTreeNode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AXIsolatedTreeNode.h; sourceTree = "<group>"; };
+               29AE213421ABA48A00869283 /* AXIsolatedTreeNode.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AXIsolatedTreeNode.cpp; sourceTree = "<group>"; };
                29D7BCF51444AF580070619C /* AccessibilitySpinButton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilitySpinButton.cpp; sourceTree = "<group>"; };
                29D7BCF91444AF7D0070619C /* AccessibilitySpinButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilitySpinButton.h; sourceTree = "<group>"; };
                29E04A27BED2F81F98E9022B /* JSBeforeUnloadEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBeforeUnloadEvent.h; sourceTree = "<group>"; };
                29A812040FBB9B4100510293 /* accessibility */ = {
                        isa = PBXGroup;
                        children = (
+                               29AE212921AB9ECB00869283 /* isolatedtree */,
                                AAA728EF16D1D8BC00D3BBC6 /* ios */,
                                29A812050FBB9B5200510293 /* mac */,
                                2981CA9D131822EC00D12F2A /* AccessibilityARIAGrid.cpp */,
                                2985709315CC532D006355CD /* AccessibilityNodeObject.h */,
                                2981CAA5131822EC00D12F2A /* AccessibilityObject.cpp */,
                                29A812180FBB9C1D00510293 /* AccessibilityObject.h */,
+                               2936BF5A21D6999E004A8FC9 /* AccessibilityObjectInterface.h */,
                                A409C982116D0DDD007197BD /* AccessibilityProgressIndicator.cpp */,
                                A409C983116D0DDD007197BD /* AccessibilityProgressIndicator.h */,
                                2981CAA6131822EC00D12F2A /* AccessibilityRenderObject.cpp */,
                        path = mac;
                        sourceTree = "<group>";
                };
+               29AE212921AB9ECB00869283 /* isolatedtree */ = {
+                       isa = PBXGroup;
+                       children = (
+                               29AE212B21AB9EEB00869283 /* AXIsolatedTree.h */,
+                               29AE212C21AB9EEB00869283 /* AXIsolatedTree.cpp */,
+                               29AE213321ABA48A00869283 /* AXIsolatedTreeNode.h */,
+                               29AE213421ABA48A00869283 /* AXIsolatedTreeNode.cpp */,
+                       );
+                       path = isolatedtree;
+                       sourceTree = "<group>";
+               };
                2D0621461DA639EC00A7FB26 /* legacy */ = {
                        isa = PBXGroup;
                        children = (
                                1AE2AA980A1CDD2D00B42B25 /* JSHTMLImageElement.h in Headers */,
                                A80E7E970A1A83E3007FB8C5 /* JSHTMLInputElement.h in Headers */,
                                836B09561F5F34D9003C3702 /* JSHTMLInputElementEntriesAPI.h in Headers */,
+                               2936BF5C21D69E4B004A8FC9 /* AccessibilityObjectInterface.h in Headers */,
                                A6148A7912E41E3B0044A784 /* JSHTMLKeygenElement.h in Headers */,
                                1AE2AB220A1CE63B00B42B25 /* JSHTMLLabelElement.h in Headers */,
                                1AE2AB240A1CE63B00B42B25 /* JSHTMLLegendElement.h in Headers */,
                                51405C89190B014400754F94 /* SelectionRectGatherer.h in Headers */,
                                E44B4BB4141650D7002B1D8B /* SelectorChecker.h in Headers */,
                                432D3FE818A8658400D7DC03 /* SelectorCheckerTestFunctions.h in Headers */,
+                               29AE213521ABA48A00869283 /* AXIsolatedTreeNode.h in Headers */,
                                26B999971804D54200D01121 /* SelectorCompiler.h in Headers */,
                                415071581685067300C3C7B3 /* SelectorFilter.h in Headers */,
                                43107BE218CC19DE00CC18E8 /* SelectorPseudoTypeMap.h in Headers */,
                                977E2E0F12F0FC9C00C13380 /* XSSAuditorDelegate.h in Headers */,
                                A5416FE618810EF80009FC5F /* YouTubeEmbedShadowElement.h in Headers */,
                                7A5515F5191830A3009687D2 /* YouTubePluginReplacement.h in Headers */,
+                               29AE212D21AB9EEB00869283 /* AXIsolatedTree.h in Headers */,
                                FD537353137B651800008DCE /* ZeroPole.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
index 8090411..f032148 100644 (file)
@@ -32,6 +32,8 @@
 
 #include "AXObjectCache.h"
 
+#include "AXIsolatedTree.h"
+#include "AXIsolatedTreeNode.h"
 #include "AccessibilityARIAGrid.h"
 #include "AccessibilityARIAGridCell.h"
 #include "AccessibilityARIAGridRow.h"
@@ -115,6 +117,8 @@ namespace WebCore {
 
 using namespace HTMLNames;
 
+const AXID InvalidAXID = 0;
+
 // Post value change notifications for password fields or elements contained in password fields at a 40hz interval to thwart analysis of typing cadence
 static const Seconds accessibilityPasswordValueChangeNotificationInterval { 25_ms };
 static const Seconds accessibilityLiveRegionChangedNotificationInterval { 20_ms };
@@ -723,6 +727,10 @@ void AXObjectCache::remove(AXID axID)
     object->setAXObjectID(0);
 
     m_idsInUse.remove(axID);
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+    if (auto pageID = m_document.pageID())
+        AXIsolatedTree::treeForPageID(*pageID)->removeNode(axID);
+#endif
 
     ASSERT(m_objects.size() >= m_idsInUse.size());
 }
@@ -2907,6 +2915,40 @@ void AXObjectCache::performDeferredCacheUpdate()
     m_deferredFocusedNodeChange.clear();
 }
     
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+Ref<AXIsolatedTreeNode> AXObjectCache::createIsolatedAccessibilityTreeHierarchy(AccessibilityObject& object, AXID parentID, AXIsolatedTree& tree, Vector<Ref<AXIsolatedTreeNode>>& nodeChanges)
+{
+    auto isolatedTreeNode = AXIsolatedTreeNode::create(object);
+    nodeChanges.append(isolatedTreeNode.copyRef());
+
+    isolatedTreeNode->setParent(parentID);
+    associateIsolatedTreeNode(object, isolatedTreeNode, tree.treeIdentifier());
+
+    for (auto child : object.children()) {
+        auto staticChild = createIsolatedAccessibilityTreeHierarchy(*child, isolatedTreeNode->identifier(), tree, nodeChanges);
+        isolatedTreeNode->appendChild(staticChild->identifier());
+    }
+
+    return isolatedTreeNode;
+}
+    
+Ref<AXIsolatedTree> AXObjectCache::generateIsolatedAccessibilityTree()
+{
+    RELEASE_ASSERT(isMainThread());
+
+    auto tree = AXIsolatedTree::treeForPageID(*m_document.pageID());
+    if (!tree)
+        tree = AXIsolatedTree::createTreeForPageID(*m_document.pageID());
+    
+    Vector<Ref<AXIsolatedTreeNode>> nodeChanges;
+    auto root = createIsolatedAccessibilityTreeHierarchy(*rootObject(), InvalidAXID, *tree, nodeChanges);
+    root->setIsRootNode(true);
+    tree->appendNodeChanges(nodeChanges);
+
+    return makeRef(*tree);
+}
+#endif
+    
 void AXObjectCache::deferRecomputeIsIgnoredIfNeeded(Element* element)
 {
     if (!nodeAndRendererAreValid(element))
index da4eba8..cf0a183 100644 (file)
@@ -25,6 +25,9 @@
 
 #pragma once
 
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+#include "AXIsolatedTree.h"
+#endif
 #include "AXTextStateChangeIntent.h"
 #include "AccessibilityObject.h"
 #include "Range.h"
@@ -39,6 +42,9 @@
 
 namespace WebCore {
 
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+class AXIsolatedTreeNode;
+#endif
 class Document;
 class HTMLAreaElement;
 class HTMLTextFormControlElement;
@@ -180,6 +186,13 @@ public:
     void deferAttributeChangeIfNeeded(const QualifiedName&, Element*);
     void recomputeIsIgnored(RenderObject* renderer);
 
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+    WEBCORE_EXPORT Ref<AXIsolatedTree> generateIsolatedAccessibilityTree();
+
+    void associateIsolatedTreeNode(AccessibilityObject&, AXIsolatedTreeNode&, AXIsolatedTreeID);
+    Ref<AXIsolatedTreeNode> createIsolatedAccessibilityTreeHierarchy(AccessibilityObject&, AXID, AXIsolatedTree&, Vector<Ref<AXIsolatedTreeNode>>&);
+#endif
+    
 #if HAVE(ACCESSIBILITY)
     WEBCORE_EXPORT static void enableAccessibility();
     WEBCORE_EXPORT static void disableAccessibility();
@@ -187,6 +200,7 @@ public:
     // Enhanced user interface accessibility can be toggled by the assistive technology.
     WEBCORE_EXPORT static void setEnhancedUserInterfaceAccessibility(bool flag);
     
+    // Note: these may be called from a non-main thread concurrently as other readers.
     static bool accessibilityEnabled() { return gAccessibilityEnabled; }
     static bool accessibilityEnhancedUserInterfaceEnabled() { return gAccessibilityEnhancedUserInterfaceEnabled; }
 #else
index 5e88796..f7fb413 100644 (file)
@@ -29,6 +29,7 @@
 
 #pragma once
 
+#include "AccessibilityObjectInterface.h"
 #include "FloatQuad.h"
 #include "HTMLTextFormControlElement.h"
 #include "LayoutRect.h"
@@ -89,157 +90,6 @@ class ScrollableArea;
 class ScrollView;
 class Widget;
 
-typedef unsigned AXID;
-
-enum class AccessibilityRole {
-    Annotation = 1,
-    Application,
-    ApplicationAlert,
-    ApplicationAlertDialog,
-    ApplicationDialog,
-    ApplicationGroup,
-    ApplicationLog,
-    ApplicationMarquee,
-    ApplicationStatus,
-    ApplicationTextGroup,
-    ApplicationTimer,
-    Audio,
-    Blockquote,
-    Browser,
-    BusyIndicator,
-    Button,
-    Canvas,
-    Caption,
-    Cell,
-    CheckBox,
-    ColorWell,
-    Column,
-    ColumnHeader,
-    ComboBox,
-    Definition,
-    DescriptionList,
-    DescriptionListTerm,
-    DescriptionListDetail,
-    Details,
-    Directory,
-    DisclosureTriangle,
-    Div,
-    Document,
-    DocumentArticle,
-    DocumentMath,
-    DocumentNote,
-    Drawer,
-    EditableText,
-    Feed,
-    Figure,
-    Footer,
-    Footnote,
-    Form,
-    GraphicsDocument,
-    GraphicsObject,
-    GraphicsSymbol,
-    Grid,
-    GridCell,
-    Group,
-    GrowArea,
-    Heading,
-    HelpTag,
-    HorizontalRule,
-    Ignored,
-    Inline,
-    Image,
-    ImageMap,
-    ImageMapLink,
-    Incrementor,
-    Label,
-    LandmarkBanner,
-    LandmarkComplementary,
-    LandmarkContentInfo,
-    LandmarkDocRegion,
-    LandmarkMain,
-    LandmarkNavigation,
-    LandmarkRegion,
-    LandmarkSearch,
-    Legend,
-    Link,
-    List,
-    ListBox,
-    ListBoxOption,
-    ListItem,
-    ListMarker,
-    Mark,
-    MathElement,
-    Matte,
-    Menu,
-    MenuBar,
-    MenuButton,
-    MenuItem,
-    MenuItemCheckbox,
-    MenuItemRadio,
-    MenuListPopup,
-    MenuListOption,
-    Outline,
-    Paragraph,
-    PopUpButton,
-    Pre,
-    Presentational,
-    ProgressIndicator,
-    RadioButton,
-    RadioGroup,
-    RowHeader,
-    Row,
-    RowGroup,
-    RubyBase,
-    RubyBlock,
-    RubyInline,
-    RubyRun,
-    RubyText,
-    Ruler,
-    RulerMarker,
-    ScrollArea,
-    ScrollBar,
-    SearchField,
-    Sheet,
-    Slider,
-    SliderThumb,
-    SpinButton,
-    SpinButtonPart,
-    SplitGroup,
-    Splitter,
-    StaticText,
-    Summary,
-    Switch,
-    SystemWide,
-    SVGRoot,
-    SVGText,
-    SVGTSpan,
-    SVGTextPath,
-    TabGroup,
-    TabList,
-    TabPanel,
-    Tab,
-    Table,
-    TableHeaderContainer,
-    TextArea,
-    TextGroup,
-    Term,
-    Time,
-    Tree,
-    TreeGrid,
-    TreeItem,
-    TextField,
-    ToggleButton,
-    Toolbar,
-    Unknown,
-    UserInterfaceTooltip,
-    ValueIndicator,
-    Video,
-    WebApplication,
-    WebArea,
-    WebCoreLink,
-    Window,
-};
-
 enum class AccessibilityTextSource {
     Alternative,
     Children,
@@ -491,7 +341,7 @@ enum class AccessibilityCurrentState { False, True, Page, Step, Location, Date,
     
 bool nodeHasPresentationRole(Node*);
     
-class AccessibilityObject : public RefCounted<AccessibilityObject> {
+class AccessibilityObject : public RefCounted<AccessibilityObject>, public AccessibilityObjectInterface {
 protected:
     AccessibilityObject() = default;
     
@@ -1159,7 +1009,10 @@ protected:
     AccessibilityIsIgnoredFromParentData m_isIgnoredFromParentData { };
     bool m_childrenDirty { false };
     bool m_subtreeDirty { false };
-
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+    bool m_isolatedTreeNodeInitialized { false };
+#endif
+    
     void setIsIgnoredFromParentData(AccessibilityIsIgnoredFromParentData& data) { m_isIgnoredFromParentData = data; }
 
     virtual bool computeAccessibilityIsIgnored() const { return true; }
diff --git a/Source/WebCore/accessibility/AccessibilityObjectInterface.h b/Source/WebCore/accessibility/AccessibilityObjectInterface.h
new file mode 100644 (file)
index 0000000..7abd287
--- /dev/null
@@ -0,0 +1,191 @@
+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+namespace WebCore {
+
+typedef unsigned AXID;
+extern const AXID InvalidAXID;
+
+enum class AccessibilityRole {
+    Annotation = 1,
+    Application,
+    ApplicationAlert,
+    ApplicationAlertDialog,
+    ApplicationDialog,
+    ApplicationGroup,
+    ApplicationLog,
+    ApplicationMarquee,
+    ApplicationStatus,
+    ApplicationTextGroup,
+    ApplicationTimer,
+    Audio,
+    Blockquote,
+    Browser,
+    BusyIndicator,
+    Button,
+    Canvas,
+    Caption,
+    Cell,
+    CheckBox,
+    ColorWell,
+    Column,
+    ColumnHeader,
+    ComboBox,
+    Definition,
+    DescriptionList,
+    DescriptionListTerm,
+    DescriptionListDetail,
+    Details,
+    Directory,
+    DisclosureTriangle,
+    Div,
+    Document,
+    DocumentArticle,
+    DocumentMath,
+    DocumentNote,
+    Drawer,
+    EditableText,
+    Feed,
+    Figure,
+    Footer,
+    Footnote,
+    Form,
+    GraphicsDocument,
+    GraphicsObject,
+    GraphicsSymbol,
+    Grid,
+    GridCell,
+    Group,
+    GrowArea,
+    Heading,
+    HelpTag,
+    HorizontalRule,
+    Ignored,
+    Inline,
+    Image,
+    ImageMap,
+    ImageMapLink,
+    Incrementor,
+    Label,
+    LandmarkBanner,
+    LandmarkComplementary,
+    LandmarkContentInfo,
+    LandmarkDocRegion,
+    LandmarkMain,
+    LandmarkNavigation,
+    LandmarkRegion,
+    LandmarkSearch,
+    Legend,
+    Link,
+    List,
+    ListBox,
+    ListBoxOption,
+    ListItem,
+    ListMarker,
+    Mark,
+    MathElement,
+    Matte,
+    Menu,
+    MenuBar,
+    MenuButton,
+    MenuItem,
+    MenuItemCheckbox,
+    MenuItemRadio,
+    MenuListPopup,
+    MenuListOption,
+    Outline,
+    Paragraph,
+    PopUpButton,
+    Pre,
+    Presentational,
+    ProgressIndicator,
+    RadioButton,
+    RadioGroup,
+    RowHeader,
+    Row,
+    RowGroup,
+    RubyBase,
+    RubyBlock,
+    RubyInline,
+    RubyRun,
+    RubyText,
+    Ruler,
+    RulerMarker,
+    ScrollArea,
+    ScrollBar,
+    SearchField,
+    Sheet,
+    Slider,
+    SliderThumb,
+    SpinButton,
+    SpinButtonPart,
+    SplitGroup,
+    Splitter,
+    StaticText,
+    Summary,
+    Switch,
+    SystemWide,
+    SVGRoot,
+    SVGText,
+    SVGTSpan,
+    SVGTextPath,
+    TabGroup,
+    TabList,
+    TabPanel,
+    Tab,
+    Table,
+    TableHeaderContainer,
+    TextArea,
+    TextGroup,
+    Term,
+    Time,
+    Tree,
+    TreeGrid,
+    TreeItem,
+    TextField,
+    ToggleButton,
+    Toolbar,
+    Unknown,
+    UserInterfaceTooltip,
+    ValueIndicator,
+    Video,
+    WebApplication,
+    WebArea,
+    WebCoreLink,
+    Window,
+};
+
+class AccessibilityObjectInterface {
+public:
+    virtual ~AccessibilityObjectInterface() = default;
+
+    virtual bool isMediaControlLabel() const = 0;
+    virtual AccessibilityRole roleValue() const = 0;
+    virtual bool isAttachment() const = 0;
+};
+
+}
diff --git a/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp b/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp
new file mode 100644 (file)
index 0000000..4fc15d7
--- /dev/null
@@ -0,0 +1,143 @@
+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+
+#include "config.h"
+#include "AXIsolatedTree.h"
+
+#include "AXIsolatedTreeNode.h"
+#include "Page.h"
+#include <wtf/NeverDestroyed.h>
+
+namespace WebCore {
+
+static Lock s_cacheLock;
+
+static unsigned newTreeID()
+{
+    static unsigned s_currentTreeID = 0;
+    return ++s_currentTreeID;
+}
+
+HashMap<AXIsolatedTreeID, Ref<AXIsolatedTree>>& AXIsolatedTree::treePageCache()
+{
+    static NeverDestroyed<HashMap<AXIsolatedTreeID, Ref<AXIsolatedTree>>> map;
+    return map;
+}
+
+HashMap<AXIsolatedTreeID, Ref<AXIsolatedTree>>& AXIsolatedTree::treeIDCache()
+{
+    static NeverDestroyed<HashMap<AXIsolatedTreeID, Ref<AXIsolatedTree>>> map;
+    return map;
+}
+
+AXIsolatedTree::AXIsolatedTree()
+    : m_treeID(newTreeID())
+{
+}
+
+AXIsolatedTree::~AXIsolatedTree() = default;
+
+Ref<AXIsolatedTree> AXIsolatedTree::create()
+{
+    ASSERT(isMainThread());
+    return adoptRef(*new AXIsolatedTree());
+}
+
+RefPtr<AXIsolatedTree> AXIsolatedTree::treeForID(AXIsolatedTreeID treeID)
+{
+    return treeIDCache().get(treeID);
+}
+
+Ref<AXIsolatedTree> AXIsolatedTree::createTreeForPageID(uint64_t pageID)
+{
+    LockHolder locker(s_cacheLock);
+
+    auto newTree = AXIsolatedTree::create();
+    treePageCache().set(pageID, newTree.copyRef());
+    treeIDCache().set(newTree->treeIdentifier(), newTree.copyRef());
+    return newTree;
+}
+
+RefPtr<AXIsolatedTree> AXIsolatedTree::treeForPageID(uint64_t pageID)
+{
+    LockHolder locker(s_cacheLock);
+
+    if (auto tree = treePageCache().get(pageID))
+        return makeRefPtr(tree);
+
+    return nullptr;
+}
+
+RefPtr<AXIsolatedTreeNode> AXIsolatedTree::nodeForID(AXID axID) const
+{
+    ASSERT(!isMainThread());
+    if (!axID)
+        return nullptr;
+    return m_readerThreadNodeMap.get(axID);
+}
+
+RefPtr<AXIsolatedTreeNode> AXIsolatedTree::rootNode()
+{
+    return nodeForID(m_rootNodeID);
+}
+
+void AXIsolatedTree::removeNode(AXID axID)
+{
+    LockHolder locker(m_changeLogLock);
+    m_pendingRemovals.append(axID);
+}
+
+void AXIsolatedTree::appendNodeChanges(Vector<Ref<AXIsolatedTreeNode>>& log)
+{
+    LockHolder locker(m_changeLogLock);
+    for (auto& node : log)
+        m_pendingAppends.append(node.copyRef());
+}
+
+void AXIsolatedTree::applyPendingChanges()
+{
+    RELEASE_ASSERT(!isMainThread());
+
+    LockHolder locker(m_changeLogLock);
+    Vector<Ref<AXIsolatedTreeNode>> appendCopy;
+    std::swap(appendCopy, m_pendingAppends);
+    Vector<AXID> removeCopy({ WTFMove(m_pendingRemovals) });
+    locker.unlockEarly();
+
+    for (auto& item : appendCopy) {
+        m_readerThreadNodeMap.add(item->identifier(), item.copyRef());
+        if (item->isRootNode())
+            m_rootNodeID = item->identifier();
+    }
+
+    for (auto item : removeCopy)
+        m_readerThreadNodeMap.remove(item);
+}
+    
+} // namespace WebCore
+
+#endif // ENABLE(ACCESSIBILITY_ISOLATED_TREE)
diff --git a/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h b/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h
new file mode 100644 (file)
index 0000000..971f9ea
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+
+#include "AXIsolatedTreeNode.h"
+#include <wtf/HashMap.h>
+#include <wtf/RefPtr.h>
+#include <wtf/ThreadSafeRefCounted.h>
+
+namespace WebCore {
+
+class Page;
+
+typedef unsigned AXIsolatedTreeID;
+    
+class AXIsolatedTree : public ThreadSafeRefCounted<AXIsolatedTree> {
+    WTF_MAKE_NONCOPYABLE(AXIsolatedTree); WTF_MAKE_FAST_ALLOCATED;
+
+public:
+    static Ref<AXIsolatedTree> create();
+    virtual ~AXIsolatedTree();
+
+    // Creation must happen on main thread.
+    static Ref<AXIsolatedTree> createTreeForPageID(uint64_t pageID);
+    WEBCORE_EXPORT static RefPtr<AXIsolatedTree> treeForPageID(uint64_t pageID);
+    WEBCORE_EXPORT static RefPtr<AXIsolatedTree> treeForID(AXIsolatedTreeID);
+
+    WEBCORE_EXPORT RefPtr<AXIsolatedTreeNode> rootNode();
+    RefPtr<AXIsolatedTreeNode> nodeForID(AXID) const;
+
+    // Call on main thread
+    void appendNodeChanges(Vector<Ref<AXIsolatedTreeNode>>&);
+    void removeNode(AXID);
+
+    // Call on AX thread
+    WEBCORE_EXPORT void applyPendingChanges();
+
+    AXIsolatedTreeID treeIdentifier() const { return m_treeID; }
+
+private:
+    AXIsolatedTree();
+
+    static HashMap<AXIsolatedTreeID, Ref<AXIsolatedTree>>& treeIDCache();
+    static HashMap<AXIsolatedTreeID, Ref<AXIsolatedTree>>& treePageCache();
+    
+    // Only access on AX thread requesting data.
+    HashMap<AXID, Ref<AXIsolatedTreeNode>> m_readerThreadNodeMap;
+
+    // Written to by main thread under lock, accessed and applied by AX thread.
+    Vector<Ref<AXIsolatedTreeNode>> m_pendingAppends;
+    Vector<AXID> m_pendingRemovals;
+    Lock m_changeLogLock;
+
+    AXIsolatedTreeID m_treeID;
+    AXID m_rootNodeID;
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/WebCore/accessibility/isolatedtree/AXIsolatedTreeNode.cpp b/Source/WebCore/accessibility/isolatedtree/AXIsolatedTreeNode.cpp
new file mode 100644 (file)
index 0000000..12bda1f
--- /dev/null
@@ -0,0 +1,129 @@
+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+
+#include "config.h"
+#include "AXIsolatedTreeNode.h"
+
+#include "AccessibilityObject.h"
+
+namespace WebCore {
+
+AXIsolatedTreeNode::AXIsolatedTreeNode(const AccessibilityObject& object)
+    : m_identifier(object.axObjectID())
+    , m_initialized(false)
+{
+    ASSERT(isMainThread());
+    initializeAttributeData(object);
+#if !ASSERT_DISABLED
+    m_initialized = true;
+#endif
+}
+
+Ref<AXIsolatedTreeNode> AXIsolatedTreeNode::create(const AccessibilityObject& object)
+{
+    return adoptRef(*new AXIsolatedTreeNode(object));
+}
+
+AXIsolatedTreeNode::~AXIsolatedTreeNode() = default;
+
+void AXIsolatedTreeNode::initializeAttributeData(const AccessibilityObject& object)
+{
+    setProperty(AXPropertyName::RoleValue, static_cast<int>(object.roleValue()));
+    setProperty(AXPropertyName::IsAttachment, object.isAttachment());
+    setProperty(AXPropertyName::IsMediaControlLabel, object.isMediaControlLabel());
+}
+
+void AXIsolatedTreeNode::setProperty(AXPropertyName propertyName, AttributeValueVariant&& value, bool shouldRemove)
+{
+    ASSERT(!m_initialized);
+    ASSERT(isMainThread());
+
+    if (shouldRemove)
+        m_attributeMap.remove(propertyName);
+    else
+        m_attributeMap.set(propertyName, value);
+}
+
+void AXIsolatedTreeNode::appendChild(AXID axID)
+{
+    ASSERT(isMainThread());
+    m_children.append(axID);
+}
+
+double AXIsolatedTreeNode::doubleAttributeValue(AXPropertyName propertyName) const
+{
+    auto value = m_attributeMap.get(propertyName);
+    return WTF::switchOn(value, [&] (double& typedValue) {
+        return typedValue;
+    }, [&] (auto&) {
+        return 0.0;
+    });
+}
+
+unsigned AXIsolatedTreeNode::unsignedAttributeValue(AXPropertyName propertyName) const
+{
+    auto value = m_attributeMap.get(propertyName);
+    return WTF::switchOn(value, [&] (unsigned& typedValue) {
+        return typedValue;
+    }, [&] (auto&) {
+        return 0;
+    });
+}
+
+bool AXIsolatedTreeNode::boolAttributeValue(AXPropertyName propertyName) const
+{
+    auto value = m_attributeMap.get(propertyName);
+    return WTF::switchOn(value, [&] (bool& typedValue) {
+        return typedValue;
+    }, [&] (auto&) {
+        return false;
+    });
+}
+
+const String& AXIsolatedTreeNode::stringAttributeValue(AXPropertyName propertyName) const
+{
+    auto value = m_attributeMap.get(propertyName);
+    return WTF::switchOn(value, [&] (String& typedValue) {
+        return typedValue;
+    }, [&] (auto&) {
+        return nullAtom();
+    });
+}
+
+int AXIsolatedTreeNode::intAttributeValue(AXPropertyName propertyName) const
+{
+    auto value = m_attributeMap.get(propertyName);
+    return WTF::switchOn(value, [&] (int& typedValue) {
+        return typedValue;
+    }, [&] (auto&) {
+        return 0;
+    });
+}
+    
+} // namespace WebCore
+
+#endif // ENABLE((ACCESSIBILITY_ISOLATED_TREE)
diff --git a/Source/WebCore/accessibility/isolatedtree/AXIsolatedTreeNode.h b/Source/WebCore/accessibility/isolatedtree/AXIsolatedTreeNode.h
new file mode 100644 (file)
index 0000000..dd3c34f
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+* Copyright (C) 2019 Apple Inc. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+* 1. Redistributions of source code must retain the above copyright
+*    notice, this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright
+*    notice, this list of conditions and the following disclaimer in the
+*    documentation and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+* THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#pragma once
+
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+
+#include "AccessibilityObjectInterface.h"
+#include <wtf/Forward.h>
+#include <wtf/HashMap.h>
+#include <wtf/RefPtr.h>
+#include <wtf/RetainPtr.h>
+#include <wtf/ThreadSafeRefCounted.h>
+#include <wtf/Variant.h>
+#include <wtf/Vector.h>
+#include <wtf/WeakPtr.h>
+
+#if PLATFORM(COCOA)
+OBJC_CLASS WebAccessibilityObjectWrapper;
+#endif
+
+namespace WebCore {
+
+class AccessibilityObject;
+
+class AXIsolatedTreeNode final : public AccessibilityObjectInterface, public ThreadSafeRefCounted<AXIsolatedTreeNode>, public CanMakeWeakPtr<AXIsolatedTreeNode> {
+
+public:
+    enum class AXPropertyName : uint8_t {
+        None = 0,
+        RoleValue = 1,
+        IsAttachment,
+        IsMediaControlLabel,
+    };
+
+    static Ref<AXIsolatedTreeNode> create(const AccessibilityObject&);
+    virtual ~AXIsolatedTreeNode();
+
+    AXID identifier() const { return m_identifier; }
+
+    bool isRootNode() const { return m_isRootNode; }
+    void setIsRootNode(bool value)
+    {
+        ASSERT(isMainThread());
+        m_isRootNode = value;
+    }
+
+    void setParent(AXID parent)
+    {
+        ASSERT(isMainThread());
+        m_parent = parent;
+    }
+    AXID parent() const { return m_parent; }
+
+    void appendChild(AXID);
+    const Vector<AXID>& children() const { return m_children; };
+
+#if PLATFORM(COCOA)
+    WebAccessibilityObjectWrapper* wrapper() const { return m_wrapper.get(); }
+    void setWrapper(WebAccessibilityObjectWrapper* wrapper) { m_wrapper = wrapper; }
+#endif
+
+protected:
+    AXIsolatedTreeNode() = default;
+
+private:
+    AXIsolatedTreeNode(const AccessibilityObject&);
+    void initializeAttributeData(const AccessibilityObject&);
+
+    bool isMediaControlLabel() const override { return boolAttributeValue(AXPropertyName::IsMediaControlLabel); }
+    bool isAttachment() const override { return boolAttributeValue(AXPropertyName::IsAttachment); }
+    AccessibilityRole roleValue() const override { return static_cast<AccessibilityRole>(intAttributeValue(AXPropertyName::RoleValue)); }
+
+    using AttributeValueVariant = Variant<std::nullptr_t, String, bool, int, unsigned, double>;
+    void setProperty(AXPropertyName, AttributeValueVariant&&, bool shouldRemove = false);
+
+    bool boolAttributeValue(AXPropertyName) const;
+    const String& stringAttributeValue(AXPropertyName) const;
+    int intAttributeValue(AXPropertyName) const;
+    unsigned unsignedAttributeValue(AXPropertyName) const;
+    double doubleAttributeValue(AXPropertyName) const;
+
+    AXID m_parent;
+    AXID m_identifier;
+    bool m_isRootNode;
+    bool m_initialized;
+    Vector<AXID> m_children;
+
+#if PLATFORM(COCOA)
+    RetainPtr<WebAccessibilityObjectWrapper> m_wrapper;
+#endif
+
+    HashMap<AXPropertyName, AttributeValueVariant, WTF::IntHash<AXPropertyName>, WTF::StrongEnumHashTraits<AXPropertyName>> m_attributeMap;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE((ACCESSIBILITY_ISOLATED_TREE))
index f754976..2fd9d9a 100644 (file)
@@ -28,6 +28,7 @@
 
 #if HAVE(ACCESSIBILITY) && PLATFORM(MAC)
 
+#import "AXIsolatedTreeNode.h"
 #import "AccessibilityObject.h"
 #import "AccessibilityTable.h"
 #import "RenderObject.h"
@@ -237,6 +238,14 @@ void AXObjectCache::detachWrapper(AccessibilityObject* obj, AccessibilityDetachm
     obj->setWrapper(nullptr);
 }
 
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+void AXObjectCache::associateIsolatedTreeNode(AccessibilityObject& object, AXIsolatedTreeNode& node, AXIsolatedTreeID treeID)
+{
+    object.wrapper().isolatedTreeIdentifier = treeID;
+    node.setWrapper(object.wrapper());
+}
+#endif
+
 void AXObjectCache::attachWrapper(AccessibilityObject* obj)
 {
     RetainPtr<WebAccessibilityObjectWrapper> wrapper = adoptNS([[WebAccessibilityObjectWrapper alloc] initWithAccessibilityObject:obj]);
index c31cab8..0cc4104 100644 (file)
 #ifndef WebAccessibilityObjectWrapperBase_h
 #define WebAccessibilityObjectWrapperBase_h
 
+#include "AXIsolatedTree.h"
 #include "AccessibilityObject.h"
 #include <CoreGraphics/CoreGraphics.h>
+#include <wtf/RefPtr.h>
+#include <wtf/Variant.h>
+#include <wtf/WeakPtr.h>
 
 namespace WebCore {
 class AccessibilityObject;
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+class AXIsolatedTreeNode;
+#endif
 struct AccessibilitySearchCriteria;
 class IntRect;
 class FloatPoint;
@@ -44,13 +51,26 @@ class VisiblePosition;
 
 @interface WebAccessibilityObjectWrapperBase : NSObject {
     WebCore::AccessibilityObject* m_object;
+    WebCore::AXID _identifier;
 }
  
 - (id)initWithAccessibilityObject:(WebCore::AccessibilityObject*)axObject;
+
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+@property (nonatomic, readonly) RefPtr<WebCore::AXIsolatedTreeNode> isolatedTreeNode;
+@property (nonatomic, assign) WebCore::AXIsolatedTreeID isolatedTreeIdentifier;
+#endif
+
 - (void)detach;
+
+@property (nonatomic, assign) WebCore::AXID identifier;
+
 - (WebCore::AccessibilityObject*)accessibilityObject;
 - (BOOL)updateObjectBackingStore;
 
+// This can be either an AccessibilityObject or an AXIsolatedTreeNode
+- (WebCore::AccessibilityObjectInterface*)axBackingObject;
+
 // These are pre-fixed with base so that AppKit does not end up calling into these directly (bypassing safety checks).
 - (NSString *)baseAccessibilityTitle;
 - (NSString *)baseAccessibilityDescription;
index 7ad8510..44d3d69 100644 (file)
 
 #if HAVE(ACCESSIBILITY)
 
+#import "AXIsolatedTree.h"
+#import "AXIsolatedTreeNode.h"
 #import "AXObjectCache.h"
 #import "AccessibilityARIAGridRow.h"
 #import "AccessibilityList.h"
 #import "AccessibilityListBox.h"
+#import "AccessibilityObjectInterface.h"
 #import "AccessibilityRenderObject.h"
 #import "AccessibilityScrollView.h"
 #import "AccessibilitySpinButton.h"
@@ -270,22 +273,47 @@ NSArray *convertToNSArray(const AccessibilityObject::AccessibilityChildrenVector
 
 @implementation WebAccessibilityObjectWrapperBase
 
+@synthesize identifier=_identifier;
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+@synthesize isolatedTreeIdentifier=_isolatedTreeIdentifier;
+#endif
+
 - (id)initWithAccessibilityObject:(AccessibilityObject*)axObject
 {
     if (!(self = [super init]))
         return nil;
 
     m_object = axObject;
+    _identifier = m_object->axObjectID();
+
     return self;
 }
 
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+- (RefPtr<WebCore::AXIsolatedTreeNode>)isolatedTreeNode
+{
+    RELEASE_ASSERT(!isMainThread());
+    return AXIsolatedTree::treeForID(_isolatedTreeIdentifier)->nodeForID(_identifier);
+}
+#endif
+
 - (void)detach
 {
     m_object = nullptr;
+    _identifier = 0;
+
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+    _isolatedTreeIdentifier = 0;
+#endif
 }
 
 - (BOOL)updateObjectBackingStore
 {
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+    RELEASE_ASSERT(!isMainThread());
+    AXIsolatedTree::treeForID(self.isolatedTreeIdentifier)->applyPendingChanges();
+    return _identifier;
+#else
     // Calling updateBackingStore() can invalidate this element so self must be retained.
     // If it does become invalidated, m_object will be nil.
     CFRetain((__bridge CFTypeRef)self);
@@ -299,6 +327,7 @@ NSArray *convertToNSArray(const AccessibilityObject::AccessibilityChildrenVector
         return NO;
     
     return YES;
+#endif
 }
 
 - (id)attachmentView
@@ -360,11 +389,21 @@ NSArray *convertToNSArray(const AccessibilityObject::AccessibilityChildrenVector
     return [NSString string];
 }
 
+#define _axBackingObject self.axBackingObject
+- (WebCore::AccessibilityObjectInterface*)axBackingObject
+{
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+    return self.isolatedTreeNode.get();
+#else
+    return m_object;
+#endif
+}
+
 - (NSString *)baseAccessibilityDescription
 {
     // Static text objects should not have a description. Its content is communicated in its AXValue.
     // One exception is the media control labels that have a value and a description. Those are set programatically.
-    if (m_object->roleValue() == AccessibilityRole::StaticText && !m_object->isMediaControlLabel())
+    if (_axBackingObject->roleValue() == AccessibilityRole::StaticText && !_axBackingObject->isMediaControlLabel())
         return [NSString string];
     
     Vector<AccessibilityText> textOrder;
index 370597f..ea83ea1 100644 (file)
@@ -416,6 +416,8 @@ using namespace HTMLNames;
 #define NSAccessibilityRelativeFrameAttribute @"AXRelativeFrame"
 #endif
 
+#define _axBackingObject self.axBackingObject
+
 extern "C" AXUIElementRef NSAccessibilityCreateAXUIElementRef(id element);
 
 @implementation WebAccessibilityObjectWrapper
@@ -1970,10 +1972,10 @@ static NSString *roleValueToNSString(AccessibilityRole value)
 - (NSString*)role
 {
     ALLOW_DEPRECATED_DECLARATIONS_BEGIN
-    if (m_object->isAttachment())
+    if (_axBackingObject->isAttachment())
         return [[self attachmentView] accessibilityAttributeValue:NSAccessibilityRoleAttribute];
     ALLOW_DEPRECATED_DECLARATIONS_END
-    AccessibilityRole role = m_object->roleValue();
+    AccessibilityRole role = _axBackingObject->roleValue();
 
     if (role == AccessibilityRole::Label && is<AccessibilityLabel>(*m_object) && downcast<AccessibilityLabel>(*m_object).containsOnlyStaticText())
         role = AccessibilityRole::StaticText;
@@ -2000,7 +2002,7 @@ ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     if (m_object->isSearchField())
         return NSAccessibilitySearchFieldSubrole;
     
-    if (m_object->isAttachment()) {
+    if (_axBackingObject->isAttachment()) {
         NSView* attachView = [self attachmentView];
         if ([[attachView accessibilityAttributeNames] containsObject:NSAccessibilitySubroleAttribute])
             return [attachView accessibilityAttributeValue:NSAccessibilitySubroleAttribute];
@@ -2211,7 +2213,7 @@ ALLOW_DEPRECATED_DECLARATIONS_END
 
     ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     // attachments have the AXImage role, but a different subrole
-    if (m_object->isAttachment())
+    if (_axBackingObject->isAttachment())
         return [[self attachmentView] accessibilityAttributeValue:NSAccessibilityRoleDescriptionAttribute];
     ALLOW_DEPRECATED_DECLARATIONS_END
 
@@ -2568,7 +2570,7 @@ IGNORE_WARNINGS_END
         return [NSNumber numberWithBool: m_object->isVisited()];
     
     if ([attributeName isEqualToString: NSAccessibilityTitleAttribute]) {
-        if (m_object->isAttachment()) {
+        if (_axBackingObject->isAttachment()) {
             if ([[[self attachmentView] accessibilityAttributeNames] containsObject:NSAccessibilityTitleAttribute])
                 return [[self attachmentView] accessibilityAttributeValue:NSAccessibilityTitleAttribute];
         }
@@ -2585,7 +2587,7 @@ IGNORE_WARNINGS_END
     }
     
     if ([attributeName isEqualToString: NSAccessibilityDescriptionAttribute]) {
-        if (m_object->isAttachment()) {
+        if (_axBackingObject->isAttachment()) {
             if ([[[self attachmentView] accessibilityAttributeNames] containsObject:NSAccessibilityDescriptionAttribute])
                 return [[self attachmentView] accessibilityAttributeValue:NSAccessibilityDescriptionAttribute];
         }
@@ -2593,7 +2595,7 @@ IGNORE_WARNINGS_END
     }
     
     if ([attributeName isEqualToString: NSAccessibilityValueAttribute]) {
-        if (m_object->isAttachment()) {
+        if (_axBackingObject->isAttachment()) {
             if ([[[self attachmentView] accessibilityAttributeNames] containsObject:NSAccessibilityValueAttribute])
                 return [[self attachmentView] accessibilityAttributeValue:NSAccessibilityValueAttribute];
         }
index f86b36f..6d443e7 100644 (file)
@@ -8217,6 +8217,11 @@ Logger& Document::logger()
 
     return *m_logger;
 }
+    
+Optional<uint64_t> Document::pageID() const
+{
+    return m_frame->loader().client().pageID();
+}
 
 void Document::hasStorageAccess(Ref<DeferredPromise>&& promise)
 {
index bb5c1c0..30f0ee6 100644 (file)
@@ -648,6 +648,7 @@ public:
     WEBCORE_EXPORT AXObjectCache* axObjectCache() const;
     void clearAXObjectCache();
 
+    Optional<uint64_t> pageID() const;
     // to get visually ordered hebrew and arabic pages right
     void setVisuallyOrdered();
     bool visuallyOrdered() const { return m_visuallyOrdered; }
index 03a1013..10d9d2c 100644 (file)
@@ -1,3 +1,15 @@
+2019-01-27  Chris Fleizach  <cfleizach@apple.com>
+
+        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]):
+
 2019-01-26  Simon Fraser  <simon.fraser@apple.com>
 
         Allow scrolling tree nodes to exist in a detached state
index 9122a25..230623e 100644 (file)
@@ -40,6 +40,8 @@ ENABLE_ACCELERATED_2D_CANVAS = ;
 ENABLE_ACCELERATED_OVERFLOW_SCROLLING = $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING_$(WK_COCOA_TOUCH));
 ENABLE_ACCELERATED_OVERFLOW_SCROLLING_cocoatouch = ENABLE_ACCELERATED_OVERFLOW_SCROLLING;
 
+ENABLE_ACCESSIBILITY_ISOLATED_TREE = ;
+
 ENABLE_APPLE_PAY = $(ENABLE_APPLE_PAY_$(WK_PLATFORM_NAME));
 ENABLE_APPLE_PAY_iphoneos = ENABLE_APPLE_PAY;
 ENABLE_APPLE_PAY_iphonesimulator = ENABLE_APPLE_PAY;
@@ -407,4 +409,4 @@ ENABLE_WIRELESS_PLAYBACK_TARGET = ENABLE_WIRELESS_PLAYBACK_TARGET;
 
 ENABLE_XSLT = ENABLE_XSLT;
 
-FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_C_LOOP) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FTL_JIT) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_EVENTS) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_WEB_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_USERSELECT_ALL) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_RTC) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBASSEMBLY_STREAMING_API) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEBMETAL) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_ACCESSIBILITY_ISOLATED_TREE) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_C_LOOP) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FTL_JIT) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_EVENTS) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_WEB_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_USERSELECT_ALL) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_RTC) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBASSEMBLY_STREAMING_API) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEBMETAL) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
index be793b7..bb47ab3 100644 (file)
@@ -32,7 +32,9 @@ class WebPage;
 
 @interface WKAccessibilityWebPageObjectBase : NSObject {
     WebKit::WebPage* m_page;
+    uint64_t m_pageID;
     id m_parent;
+    bool m_hasPlugin;
 }
 
 - (void)setWebPage:(WebKit::WebPage*)page;
index 9a90506..994cbaa 100644 (file)
@@ -34,6 +34,7 @@
 #import "WKSharedAPICast.h"
 #import "WKString.h"
 #import "WKStringCF.h"
+#import <WebCore/AXIsolatedTree.h>
 #import <WebCore/AXObjectCache.h>
 #import <WebCore/Document.h>
 #import <WebCore/Frame.h>
@@ -47,39 +48,93 @@ using namespace WebKit;
 
 @implementation WKAccessibilityWebPageObjectBase
 
-- (id)accessibilityRootObjectWrapper
+- (WebCore::AXObjectCache*)axObjectCache
 {
-    if (!WebCore::AXObjectCache::accessibilityEnabled())
-        WebCore::AXObjectCache::enableAccessibility();
-
-    if (!m_page)
-        return nil;
-    
-    NSObject* mainFramePluginAccessibilityObjectWrapper = m_page->accessibilityObjectForMainFramePlugin();
-    if (mainFramePluginAccessibilityObjectWrapper)
-        return mainFramePluginAccessibilityObjectWrapper;
-
     WebCore::Page* page = m_page->corePage();
     if (!page)
         return nil;
-    
     WebCore::Frame& core = page->mainFrame();
     if (!core.document())
         return nil;
+
+    return core.document()->axObjectCache();
+}
+
+- (id)accessibilityPluginObject
+{
+    auto retrieveBlock = [&self]() -> id {
+        id axPlugin = nil;
+        auto dispatchBlock = [&axPlugin, &self] {
+            if (self->m_page)
+                axPlugin = self->m_page->accessibilityObjectForMainFramePlugin();
+        };
+
+        if (isMainThread())
+            dispatchBlock();
+        else {
+            callOnMainThreadAndWait([&dispatchBlock] {
+                dispatchBlock();
+            });
+        }
+        return axPlugin;
+    };
     
-    WebCore::AXObjectCache* cache = core.document()->axObjectCache();
-    if (!cache)
-        return nil;
-    
-    if (WebCore::AccessibilityObject* root = cache->rootObject())
-        return root->wrapper();
-    
+    return retrieveBlock();
+}
+
+- (id)accessibilityRootObjectWrapper
+{
+    if (!WebCore::AXObjectCache::accessibilityEnabled())
+        WebCore::AXObjectCache::enableAccessibility();
+
+    if (m_hasPlugin)
+        return self.accessibilityPluginObject;
+
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+    auto generateBlock = [&] {
+        auto dispatchBlock = [&self] {
+            if (auto cache = [self axObjectCache])
+                cache->generateIsolatedAccessibilityTree();
+        };
+
+        if (isMainThread())
+            dispatchBlock();
+        else {
+            callOnMainThreadAndWait([&dispatchBlock] {
+                dispatchBlock();
+            });
+        }
+    };
+
+    auto tree = AXIsolatedTree::treeForPageID(m_pageID);
+    if (!tree)
+        generateBlock();
+
+    if ((tree = AXIsolatedTree::treeForPageID(m_pageID))) {
+        ASSERT(!isMainThread());
+        tree->applyPendingChanges();
+        return tree->rootNode()->wrapper();
+    }
+#else
+    if (AXObjectCache* cache = [self axObjectCache]) {
+        if (WebCore::AccessibilityObject* root = cache->rootObject())
+            return root->wrapper();
+    }
+#endif
     return nil;
 }
 
 - (void)setWebPage:(WebPage*)page
 {
     m_page = page;
+    
+    if (page) {
+        m_pageID = page->pageID();
+        m_hasPlugin = page->accessibilityObjectForMainFramePlugin();
+    } else {
+        m_pageID = 0;
+        m_hasPlugin = false;
+    }
 }
 
 - (void)setRemoteParent:(id)parent
index 3c6d71d..003561e 100644 (file)
@@ -1,3 +1,13 @@
+2019-01-27  Chris Fleizach  <cfleizach@apple.com>
+
+        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:
+
 2019-01-25  Keith Rollin  <krollin@apple.com>
 
         Update WebKitAdditions.xcconfig with correct order of variable definitions
index 9122a25..230623e 100644 (file)
@@ -40,6 +40,8 @@ ENABLE_ACCELERATED_2D_CANVAS = ;
 ENABLE_ACCELERATED_OVERFLOW_SCROLLING = $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING_$(WK_COCOA_TOUCH));
 ENABLE_ACCELERATED_OVERFLOW_SCROLLING_cocoatouch = ENABLE_ACCELERATED_OVERFLOW_SCROLLING;
 
+ENABLE_ACCESSIBILITY_ISOLATED_TREE = ;
+
 ENABLE_APPLE_PAY = $(ENABLE_APPLE_PAY_$(WK_PLATFORM_NAME));
 ENABLE_APPLE_PAY_iphoneos = ENABLE_APPLE_PAY;
 ENABLE_APPLE_PAY_iphonesimulator = ENABLE_APPLE_PAY;
@@ -407,4 +409,4 @@ ENABLE_WIRELESS_PLAYBACK_TARGET = ENABLE_WIRELESS_PLAYBACK_TARGET;
 
 ENABLE_XSLT = ENABLE_XSLT;
 
-FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_C_LOOP) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FTL_JIT) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_EVENTS) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_WEB_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_USERSELECT_ALL) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_RTC) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBASSEMBLY_STREAMING_API) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEBMETAL) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_ACCESSIBILITY_ISOLATED_TREE) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_C_LOOP) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FTL_JIT) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_EVENTS) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_WEB_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_USERSELECT_ALL) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_RTC) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBASSEMBLY_STREAMING_API) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEBMETAL) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
index bca4e99..f70b817 100644 (file)
@@ -193,6 +193,7 @@ macro(WEBKIT_OPTION_BEGIN)
     WEBKIT_OPTION_DEFINE(ENABLE_SMOOTH_SCROLLING "Toggle smooth scrolling" PRIVATE ON)
     WEBKIT_OPTION_DEFINE(ENABLE_SPEECH_SYNTHESIS "Toggle Speech Synthesis API support" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_SPELLCHECK "Toggle Spellchecking support (requires Enchant)" PRIVATE OFF)
+    WEBKIT_OPTION_DEFINE(ENABLE_ACCESSIBILITY_STATIC_TREE "Toggle static accessibility tree support" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_STREAMS_API "Toggle Streams API support" PRIVATE ON)
     WEBKIT_OPTION_DEFINE(ENABLE_SVG_FONTS "Toggle SVG Fonts support" PRIVATE ON)
     WEBKIT_OPTION_DEFINE(ENABLE_TELEPHONE_NUMBER_DETECTION "Toggle telephone number detection support" PRIVATE OFF)
index 1cf82ac..d0b9672 100644 (file)
@@ -1,3 +1,13 @@
+2019-01-27  Chris Fleizach  <cfleizach@apple.com>
+
+        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:
+
 2019-01-26  Zalan Bujtas  <zalan@apple.com>
 
         [LFC] The default values for top/bottom in contentHeightForFormattingContextRoot should not be 0.
index 9122a25..230623e 100644 (file)
@@ -40,6 +40,8 @@ ENABLE_ACCELERATED_2D_CANVAS = ;
 ENABLE_ACCELERATED_OVERFLOW_SCROLLING = $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING_$(WK_COCOA_TOUCH));
 ENABLE_ACCELERATED_OVERFLOW_SCROLLING_cocoatouch = ENABLE_ACCELERATED_OVERFLOW_SCROLLING;
 
+ENABLE_ACCESSIBILITY_ISOLATED_TREE = ;
+
 ENABLE_APPLE_PAY = $(ENABLE_APPLE_PAY_$(WK_PLATFORM_NAME));
 ENABLE_APPLE_PAY_iphoneos = ENABLE_APPLE_PAY;
 ENABLE_APPLE_PAY_iphonesimulator = ENABLE_APPLE_PAY;
@@ -407,4 +409,4 @@ ENABLE_WIRELESS_PLAYBACK_TARGET = ENABLE_WIRELESS_PLAYBACK_TARGET;
 
 ENABLE_XSLT = ENABLE_XSLT;
 
-FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_C_LOOP) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FTL_JIT) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_EVENTS) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_WEB_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_USERSELECT_ALL) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_RTC) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBASSEMBLY_STREAMING_API) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEBMETAL) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_ACCESSIBILITY_ISOLATED_TREE) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_C_LOOP) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FTL_JIT) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_EVENTS) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_WEB_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_USERSELECT_ALL) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_RTC) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBASSEMBLY_STREAMING_API) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEBMETAL) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);