Implementation of AccessibilitySupport AXSIsolatedTreeMode.
authorandresg_22@apple.com <andresg_22@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 8 Mar 2020 21:49:45 +0000 (21:49 +0000)
committerandresg_22@apple.com <andresg_22@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 8 Mar 2020 21:49:45 +0000 (21:49 +0000)
https://bugs.webkit.org/show_bug.cgi?id=208691
<rdar://problem/60178602>

Reviewed by Chris Fleizach.

Source/WebCore:

Honors the system AccessibilitySupport IsolatedTreeMode setting. The
system has three modes for IsolatedTree functionality: off, on on main
thread, and on on secondary thread.

* WebCore.xcodeproj/project.pbxproj:
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::isolatedTreeFocusedObject):
(WebCore::AXObjectCache::focusedUIElementForPage):
(WebCore::AXObjectCache::isIsolatedTreeEnabled):
(WebCore::AXObjectCache::isolatedTreeRootObject):
(WebCore::AXObjectCache::canUseSecondaryAXThread):
* accessibility/AXObjectCache.h:
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(-[WebAccessibilityObjectWrapperBase detach]):
(-[WebAccessibilityObjectWrapperBase axBackingObject]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):

Source/WebCore/PAL:

Added softlinking for the AccessibilitySupport library (libAccessibility.tbd).

* PAL.xcodeproj/project.pbxproj:
* pal/PlatformMac.cmake:
* pal/spi/cocoa/AccessibilitySupportSPI.h: Added.
* pal/spi/cocoa/AccessibilitySupportSoftLink.cpp: Added.
* pal/spi/cocoa/AccessibilitySupportSoftLink.h: Added.

Source/WebKit:

Honors system AccessibilitySupport IsolatedTreeMode setting.

* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityHitTest:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258115 268f45cc-cd09-0410-ab3c-d52691b4dbfc

14 files changed:
Source/WebCore/ChangeLog
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj
Source/WebCore/PAL/pal/PlatformMac.cmake
Source/WebCore/PAL/pal/spi/cocoa/AccessibilitySupportSPI.h [new file with mode: 0644]
Source/WebCore/PAL/pal/spi/cocoa/AccessibilitySupportSoftLink.cpp [new file with mode: 0644]
Source/WebCore/PAL/pal/spi/cocoa/AccessibilitySupportSoftLink.h [new file with mode: 0644]
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/accessibility/AXObjectCache.cpp
Source/WebCore/accessibility/AXObjectCache.h
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm

index 54be05a..dd89d15 100644 (file)
@@ -1,3 +1,29 @@
+2020-03-08  Andres Gonzalez  <andresg_22@apple.com>
+
+        Implementation of AccessibilitySupport AXSIsolatedTreeMode.
+        https://bugs.webkit.org/show_bug.cgi?id=208691
+        <rdar://problem/60178602>
+
+        Reviewed by Chris Fleizach.
+
+        Honors the system AccessibilitySupport IsolatedTreeMode setting. The
+        system has three modes for IsolatedTree functionality: off, on on main
+        thread, and on on secondary thread.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * accessibility/AXObjectCache.cpp:
+        (WebCore::AXObjectCache::isolatedTreeFocusedObject):
+        (WebCore::AXObjectCache::focusedUIElementForPage):
+        (WebCore::AXObjectCache::isIsolatedTreeEnabled):
+        (WebCore::AXObjectCache::isolatedTreeRootObject):
+        (WebCore::AXObjectCache::canUseSecondaryAXThread):
+        * accessibility/AXObjectCache.h:
+        * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
+        (-[WebAccessibilityObjectWrapperBase detach]):
+        (-[WebAccessibilityObjectWrapperBase axBackingObject]):
+        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+        (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
+
 2020-03-08  Jer Noble  <jer.noble@apple.com>
 
         Unreviewed watchOS build fix: add platform guards.
index ff54818..8ff10fd 100644 (file)
@@ -1,3 +1,19 @@
+2020-03-08  Andres Gonzalez  <andresg_22@apple.com>
+
+        Implementation of AccessibilitySupport AXSIsolatedTreeMode.
+        https://bugs.webkit.org/show_bug.cgi?id=208691
+        <rdar://problem/60178602>
+
+        Reviewed by Chris Fleizach.
+
+        Added softlinking for the AccessibilitySupport library (libAccessibility.tbd).
+
+        * PAL.xcodeproj/project.pbxproj:
+        * pal/PlatformMac.cmake:
+        * pal/spi/cocoa/AccessibilitySupportSPI.h: Added.
+        * pal/spi/cocoa/AccessibilitySupportSoftLink.cpp: Added.
+        * pal/spi/cocoa/AccessibilitySupportSoftLink.h: Added.
+
 2020-03-07  Daniel Bates  <dabates@apple.com>
 
         [iOS] Implement support for dictation alternatives
index 83fc5f4..cdff9af 100644 (file)
                1CCEE4F520D871930047B097 /* CoreUISPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CCEE4F420D871930047B097 /* CoreUISPI.h */; };
                1CCEE4F720D8743F0047B097 /* NSAppearanceSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CCEE4F620D8743F0047B097 /* NSAppearanceSPI.h */; };
                1D12CC4B2411BCAE00FDA0A3 /* FeatureFlagsSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 1D12CC4A2411BCAE00FDA0A3 /* FeatureFlagsSPI.h */; };
+               293EE4A824154F8F0047493D /* AccessibilitySupportSoftLink.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 293EE4A624154F8F0047493D /* AccessibilitySupportSoftLink.cpp */; };
+               293EE4A924154F8F0047493D /* AccessibilitySupportSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 293EE4A724154F8F0047493D /* AccessibilitySupportSoftLink.h */; };
                2D02E93C2056FAA700A13797 /* AudioToolboxSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D02E93B2056FAA700A13797 /* AudioToolboxSPI.h */; };
                2E1342CC215AA10A007199D2 /* UIKitSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E1342CA215AA10A007199D2 /* UIKitSoftLink.h */; };
                2E1342CD215AA10A007199D2 /* UIKitSoftLink.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2E1342CB215AA10A007199D2 /* UIKitSoftLink.mm */; };
                1CCEE4F420D871930047B097 /* CoreUISPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreUISPI.h; sourceTree = "<group>"; };
                1CCEE4F620D8743F0047B097 /* NSAppearanceSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSAppearanceSPI.h; sourceTree = "<group>"; };
                1D12CC4A2411BCAE00FDA0A3 /* FeatureFlagsSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FeatureFlagsSPI.h; sourceTree = "<group>"; };
+               293EE4A624154F8F0047493D /* AccessibilitySupportSoftLink.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilitySupportSoftLink.cpp; sourceTree = "<group>"; };
+               293EE4A724154F8F0047493D /* AccessibilitySupportSoftLink.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AccessibilitySupportSoftLink.h; sourceTree = "<group>"; };
                2D02E93B2056FAA700A13797 /* AudioToolboxSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioToolboxSPI.h; sourceTree = "<group>"; };
                2E1342CA215AA10A007199D2 /* UIKitSoftLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIKitSoftLink.h; sourceTree = "<group>"; };
                2E1342CB215AA10A007199D2 /* UIKitSoftLink.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UIKitSoftLink.mm; sourceTree = "<group>"; };
                A3AB6E631F3D217F009C14B1 /* SystemSleepListenerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SystemSleepListenerMac.mm; sourceTree = "<group>"; };
                A3C66CDA1F462D6A009E6EE9 /* SessionID.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SessionID.cpp; sourceTree = "<group>"; };
                A3C66CDB1F462D6A009E6EE9 /* SessionID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SessionID.h; sourceTree = "<group>"; };
+               C037494124127CCB00D9A36E /* AccessibilitySupportSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AccessibilitySupportSPI.h; sourceTree = "<group>"; };
                C15CBB3223F34A1200300CC7 /* NSUserDefaultsSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSUserDefaultsSPI.h; sourceTree = "<group>"; };
                C2147A4A1EFD0AA600056FA5 /* CopyPALHeaders.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = CopyPALHeaders.xcconfig; sourceTree = "<group>"; };
                CDACB35E23873E480018D7CE /* MediaToolboxSoftLink.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = MediaToolboxSoftLink.cpp; sourceTree = "<group>"; };
                0C2DA1201F3BE9E700DBC317 /* cocoa */ = {
                        isa = PBXGroup;
                        children = (
+                               293EE4A624154F8F0047493D /* AccessibilitySupportSoftLink.cpp */,
+                               293EE4A724154F8F0047493D /* AccessibilitySupportSoftLink.h */,
+                               C037494124127CCB00D9A36E /* AccessibilitySupportSPI.h */,
                                576CA9D522B854AB0030143C /* AppSSOSPI.h */,
                                2D02E93B2056FAA700A13797 /* AudioToolboxSPI.h */,
                                572A107722B456F500F410C8 /* AuthKitSPI.h */,
                        isa = PBXHeadersBuildPhase;
                        buildActionMask = 2147483647;
                        files = (
+                               293EE4A924154F8F0047493D /* AccessibilitySupportSoftLink.h in Headers */,
                                57FD318B22B35989008D0E8B /* AppSSOSoftLink.h in Headers */,
                                576CA9D622B854AB0030143C /* AppSSOSPI.h in Headers */,
                                2D02E93C2056FAA700A13797 /* AudioToolboxSPI.h in Headers */,
                        isa = PBXSourcesBuildPhase;
                        buildActionMask = 2147483647;
                        files = (
+                               293EE4A824154F8F0047493D /* AccessibilitySupportSoftLink.cpp in Sources */,
                                57FD318A22B3593E008D0E8B /* AppSSOSoftLink.mm in Sources */,
                                077E87B1226A460200A2AFF0 /* AVFoundationSoftLink.mm in Sources */,
                                0C5FFF0F1F78D9DA009EFF1A /* ClockCM.mm in Sources */,
index d24aae2..2810ba2 100644 (file)
@@ -20,6 +20,8 @@ list(APPEND PAL_PUBLIC_HEADERS
     spi/cg/CoreGraphicsSPI.h
     spi/cg/ImageIOSPI.h
 
+    spi/cocoa/AccessibilitySupportSPI.h
+    spi/cocoa/AccessibilitySupportSoftLink.h
     spi/cocoa/AppSSOSPI.h
     spi/cocoa/AuthKitSPI.h
     spi/cocoa/AVKitSPI.h
@@ -125,6 +127,8 @@ list(APPEND PAL_SOURCES
 
     mac/LookupSoftLink.mm
 
+    spi/cocoa/AccessibilitySupportSoftLink.cpp
+
     system/cocoa/SleepDisablerCocoa.cpp
 
     system/mac/ClockCM.mm
diff --git a/Source/WebCore/PAL/pal/spi/cocoa/AccessibilitySupportSPI.h b/Source/WebCore/PAL/pal/spi/cocoa/AccessibilitySupportSPI.h
new file mode 100644 (file)
index 0000000..a0fbe28
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2020 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 HAVE(ACCESSIBILITY_SUPPORT)
+
+#if USE(APPLE_INTERNAL_SDK)
+
+#include <AccessibilitySupport.h>
+
+#else
+
+WTF_EXTERN_C_BEGIN
+
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+typedef CF_ENUM(int32_t, AXSIsolatedTreeMode)
+{
+    AXSIsolatedTreeModeOff = 0,
+    AXSIsolatedTreeModeMainThread,
+    AXSIsolatedTreeModeSecondaryThread,
+};
+
+AXSIsolatedTreeMode _AXSIsolatedTreeMode(void);
+#endif // ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+
+WTF_EXTERN_C_END
+
+#endif // USE(APPLE_INTERNAL_SDK)
+
+#endif // HAVE(ACCESSIBILITY_SUPPORT)
diff --git a/Source/WebCore/PAL/pal/spi/cocoa/AccessibilitySupportSoftLink.cpp b/Source/WebCore/PAL/pal/spi/cocoa/AccessibilitySupportSoftLink.cpp
new file mode 100644 (file)
index 0000000..c0bcb05
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2020 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.
+ */
+
+#include "config.h"
+
+#import "AccessibilitySupportSoftLink.h"
+
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+
+SOFT_LINK_LIBRARY_FOR_SOURCE(PAL, libAccessibility)
+SOFT_LINK_FUNCTION_MAY_FAIL_FOR_SOURCE_WITH_EXPORT(PAL, libAccessibility, _AXSIsolatedTreeMode, AXSIsolatedTreeMode, (void), (), PAL_EXPORT)
+
+#endif
diff --git a/Source/WebCore/PAL/pal/spi/cocoa/AccessibilitySupportSoftLink.h b/Source/WebCore/PAL/pal/spi/cocoa/AccessibilitySupportSoftLink.h
new file mode 100644 (file)
index 0000000..d5fb9d6
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2020 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
+
+#include <pal/spi/cocoa/AccessibilitySupportSPI.h>
+#include <wtf/SoftLinking.h>
+
+WTF_EXTERN_C_BEGIN
+
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+
+SOFT_LINK_LIBRARY_FOR_HEADER(PAL, libAccessibility)
+SOFT_LINK_FUNCTION_MAY_FAIL_FOR_HEADER(PAL, libAccessibility, _AXSIsolatedTreeMode, AXSIsolatedTreeMode, (void), ())
+#define _AXSIsolatedTreeMode_Soft PAL::softLink_libAccessibility__AXSIsolatedTreeMode
+#define _AXSIsolatedTreeModeFunctionIsAvailable PAL::canLoad_libAccessibility__AXSIsolatedTreeMode
+
+#endif // ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+
+WTF_EXTERN_C_END
index 0587dec..18cafa7 100644 (file)
                C0C054CB1118C8E400CE2636 /* CodeGenerator.pm in Headers */ = {isa = PBXBuildFile; fileRef = 93F8B3050A300FE100F61AB8 /* CodeGenerator.pm */; settings = {ATTRIBUTES = (Private, ); }; };
                C0C054CC1118C8E400CE2636 /* generate-bindings.pl in Headers */ = {isa = PBXBuildFile; fileRef = 93F8B3070A300FEA00F61AB8 /* generate-bindings.pl */; settings = {ATTRIBUTES = (Private, ); }; };
                C0C054CD1118C8E400CE2636 /* IDLParser.pm in Headers */ = {isa = PBXBuildFile; fileRef = 14813BF309EDF88E00F757E1 /* IDLParser.pm */; settings = {ATTRIBUTES = (Private, ); }; };
+               C0E2F3272412BF29009C73EC /* libAccessibility.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = C0E2F3252412BF29009C73EC /* libAccessibility.tbd */; };
                C0F2A44113869AAB0066C534 /* preprocessor.pm in Headers */ = {isa = PBXBuildFile; fileRef = C0F2A43F13869A280066C534 /* preprocessor.pm */; settings = {ATTRIBUTES = (Private, ); }; };
                C105DA640F3AA6B8001DD44F /* TextEncodingDetector.h in Headers */ = {isa = PBXBuildFile; fileRef = C105DA630F3AA6B8001DD44F /* TextEncodingDetector.h */; };
                C11A9ECE21403A5C00CFB20A /* SwitchingGPUClient.h in Headers */ = {isa = PBXBuildFile; fileRef = C11A9ECD21403A5C00CFB20A /* SwitchingGPUClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
                BEF29EEA1715DD0900C4B4C9 /* VideoTrackPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoTrackPrivate.h; sourceTree = "<group>"; };
                C046E1AB1208A9FE00BA2CF7 /* LocalizedStrings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LocalizedStrings.cpp; sourceTree = "<group>"; };
                C078376023DF253E00C9C5C8 /* AXIsolatedObjectMac.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = AXIsolatedObjectMac.mm; path = mac/AXIsolatedObjectMac.mm; sourceTree = "<group>"; };
+               C0E2F3252412BF29009C73EC /* libAccessibility.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libAccessibility.tbd; path = usr/lib/libAccessibility.tbd; sourceTree = SDKROOT; };
                C0F2A43F13869A280066C534 /* preprocessor.pm */ = {isa = PBXFileReference; lastKnownFileType = text.script.perl; name = preprocessor.pm; path = scripts/preprocessor.pm; sourceTree = "<group>"; };
                C105DA610F3AA68F001DD44F /* TextEncodingDetectorICU.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextEncodingDetectorICU.cpp; sourceTree = "<group>"; };
                C105DA630F3AA6B8001DD44F /* TextEncodingDetector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextEncodingDetector.h; sourceTree = "<group>"; };
                                FD2DBF1312B048A300ED98C6 /* AudioToolbox.framework in Frameworks */,
                                1AB33DA512551E320024457A /* IOKit.framework in Frameworks */,
                                93F19B1608245E59001E9ABC /* JavaScriptCore.framework in Frameworks */,
+                               C0E2F3272412BF29009C73EC /* libAccessibility.tbd in Frameworks */,
                                1C022F0022CFED68006DF01B /* libcompression.tbd in Frameworks */,
                                93F19B1708245E59001E9ABC /* libicucore.dylib in Frameworks */,
                                1CFAE3230A6D6A3F0032593D /* libobjc.dylib in Frameworks */,
                                A15E6BF01E212A6A0080AF34 /* Foundation.framework */,
                                1AB33DA412551E320024457A /* IOKit.framework */,
                                F8216299029F4FB501000131 /* JavaScriptCore.framework */,
+                               C0E2F3252412BF29009C73EC /* libAccessibility.tbd */,
                                1C8D26D022C09CDE00D125F3 /* libcompression.tbd */,
                                93F1D31A0558CC5C00821BC0 /* libicucore.dylib */,
                                1CFAE3220A6D6A3F0032593D /* libobjc.dylib */,
index f4cfc6b..e25ebc1 100644 (file)
 #include "TextIterator.h"
 
 #if ENABLE(ACCESSIBILITY_ISOLATED_TREE) && PLATFORM(MAC)
+#include <pal/spi/cocoa/AccessibilitySupportSPI.h>
+#include <pal/spi/cocoa/AccessibilitySupportSoftLink.h>
 #include <pal/spi/mac/HIServicesSPI.h>
 #endif
 
@@ -392,6 +394,8 @@ AXCoreObject* AXObjectCache::isolatedTreeFocusedObject(Document& document)
         tree = generateIsolatedTree(*pageID, document);
         // Now that we have created our tree, initialize the secondary thread,
         // so future requests come in on the other thread.
+        if (_AXSIsolatedTreeModeFunctionIsAvailable() && _AXSIsolatedTreeMode_Soft() == AXSIsolatedTreeModeSecondaryThread)
+            _AXUIElementUseSecondaryAXThread(true);
         _AXUIElementUseSecondaryAXThread(true);
     }
 
@@ -430,7 +434,7 @@ AXCoreObject* AXObjectCache::focusedUIElementForPage(const Page* page)
     focusedDocument->updateStyleIfNeeded();
 
 #if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
-    if (clientSupportsIsolatedTree())
+    if (isIsolatedTreeEnabled())
         return isolatedTreeFocusedObject(*focusedDocument);
 #endif
 
@@ -723,6 +727,12 @@ bool AXObjectCache::clientSupportsIsolatedTree()
 
     return _AXGetClientForCurrentRequestUntrusted() == kAXClientTypeVoiceOver;
 }
+
+bool AXObjectCache::isIsolatedTreeEnabled()
+{
+    return _AXSIsolatedTreeModeFunctionIsAvailable() && _AXSIsolatedTreeMode_Soft() != AXSIsolatedTreeModeOff && clientSupportsIsolatedTree();
+}
+
 #endif
 
 AXCoreObject* AXObjectCache::rootObject()
@@ -752,7 +762,8 @@ AXCoreObject* AXObjectCache::isolatedTreeRootObject()
 
         // Now that we have created our tree, initialize the secondary thread,
         // so future requests come in on the other thread.
-        _AXUIElementUseSecondaryAXThread(true);
+        if (_AXSIsolatedTreeModeFunctionIsAvailable() && _AXSIsolatedTreeMode_Soft() == AXSIsolatedTreeModeSecondaryThread)
+            _AXUIElementUseSecondaryAXThread(true);
     }
 
     if (tree)
@@ -773,7 +784,7 @@ bool AXObjectCache::canUseSecondaryAXThread()
     // _AXUIElementRequestServicedBySecondaryAXThread returns false for
     // LayoutTests, but we still want to run LayoutTests using isolated tree on
     // a secondary thread to simulate the actual execution.
-    return clientSupportsIsolatedTree();
+    return _AXSIsolatedTreeModeFunctionIsAvailable() && _AXSIsolatedTreeMode_Soft() == AXSIsolatedTreeModeSecondaryThread && clientSupportsIsolatedTree();
 #else
     return false;
 #endif
index 2987eae..76de890 100644 (file)
@@ -352,8 +352,9 @@ public:
     RefPtr<Range> rangeMatchesTextNearRange(RefPtr<Range>, const String&);
 
 #if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
-    WEBCORE_EXPORT static bool clientSupportsIsolatedTree();
+    WEBCORE_EXPORT static bool isIsolatedTreeEnabled();
 private:
+    static bool clientSupportsIsolatedTree();
     AXCoreObject* isolatedTreeRootObject();
     static AXCoreObject* isolatedTreeFocusedObject(Document&);
     void setIsolatedTreeFocusedObject(Node*);
index 8ce8a0e..1ae6aa9 100644 (file)
@@ -327,7 +327,7 @@ NSArray *convertToNSArray(const WebCore::AXCoreObject::AccessibilityChildrenVect
     _identifier = InvalidAXID;
 #if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
     if (!isMainThread()) {
-        ASSERT(AXObjectCache::clientSupportsIsolatedTree());
+        ASSERT(AXObjectCache::isIsolatedTreeEnabled());
         [self detachIsolatedObject];
         return;
     }
@@ -366,7 +366,7 @@ NSArray *convertToNSArray(const WebCore::AXCoreObject::AccessibilityChildrenVect
 {
 #if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
     if (!isMainThread()) {
-        ASSERT(AXObjectCache::clientSupportsIsolatedTree());
+        ASSERT(AXObjectCache::isIsolatedTreeEnabled());
         return m_isolatedObject;
     }
 #endif
index 79aa841..110960c 100644 (file)
@@ -1437,7 +1437,7 @@ ALLOW_DEPRECATED_IMPLEMENTATIONS_END
         [additional addObject:NSAccessibilityExpandedTextValueAttribute];
 
 #if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
-    if (_AXUIElementRequestServicedBySecondaryAXThread() && AXObjectCache::clientSupportsIsolatedTree())
+    if (AXObjectCache::isIsolatedTreeEnabled() && _AXUIElementRequestServicedBySecondaryAXThread())
         [additional addObject:NSAccessibilityRelativeFrameAttribute];
 #endif
     
index 40dd640..6fa0f03 100644 (file)
@@ -1,3 +1,16 @@
+2020-03-08  Andres Gonzalez  <andresg_22@apple.com>
+
+        Implementation of AccessibilitySupport AXSIsolatedTreeMode.
+        https://bugs.webkit.org/show_bug.cgi?id=208691
+        <rdar://problem/60178602>
+
+        Reviewed by Chris Fleizach.
+
+        Honors system AccessibilitySupport IsolatedTreeMode setting.
+
+        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
+        (-[WKAccessibilityWebPageObject accessibilityHitTest:]):
+
 2020-03-08  Megan Gardner  <megan_gardner@apple.com>
 
         Build Fix Watch
index 4ec3e45..e8c0bcf 100644 (file)
@@ -253,8 +253,7 @@ ALLOW_DEPRECATED_DECLARATIONS_BEGIN
 
         // Isolated tree frames have the offset encoded into them so we don't need to undo here.
 #if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
-        bool queryingIsolatedTree = WebCore::AXObjectCache::clientSupportsIsolatedTree() && _AXUIElementRequestServicedBySecondaryAXThread();
-        applyContentOffset = !queryingIsolatedTree;
+        applyContentOffset = !WebCore::AXObjectCache::isIsolatedTreeEnabled() || !_AXUIElementRequestServicedBySecondaryAXThread();
 #endif
         if (auto pluginView = WebKit::WebPage::pluginViewForFrame(protectedSelf->m_page->mainFrame()))
             applyContentOffset = !pluginView->plugin()->pluginHandlesContentOffsetForAccessibilityHitTest();