Title: [252175] trunk/Source
Revision
252175
Author
[email protected]
Date
2019-11-06 23:03:17 -0800 (Wed, 06 Nov 2019)

Log Message

AX: WKWebView does not shift Accessibility Focus for Catalyst (203798)
https://bugs.webkit.org/show_bug.cgi?id=203798

Patch by Eric Liang <[email protected]> on 2019-11-06
Reviewed by Chris Fleizach.

Source/WebCore:

Changed to use the new cocoa directory instead of macOS only

* accessibility/mac/AXObjectCacheMac.mm:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:

Source/WebCore/PAL:

Changed the path of NSAccessibilitySPI from Mac to Cocoa

* PAL.xcodeproj/project.pbxproj:
* pal/spi/cocoa/NSAccessibilitySPI.h: Renamed from Source/WebCore/PAL/pal/spi/mac/NSAccessibilitySPI.h.

Source/WebKit:

Added the code to register/unregister remote UI Process identifier on the host app.
This is used so that the host app can appear as the sender for notifications sent from its web processes. Unfortunately this has to be done in WebKit: in accessibility bundles the swizzled code is not called because of bundle loading time.
Added AppKit softlink for Mac catalyst.

* SourcesCocoa.txt:
* UIProcess/Cocoa/WebViewImpl.mm:
* UIProcess/ios/AppKitSoftLink.h: Added.
* UIProcess/ios/AppKitSoftLink.mm: Added.
* UIProcess/ios/ViewGestureControllerIOS.mm:
(-[WKSwipeTransitionController gestureRecognizerForInteractiveTransition:WithTarget:action:]):
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _updateRemoteAccessibilityRegistration:]):
(-[WKContentView _accessibilityRegisterUIProcessTokens]):
(-[WKContentView _processDidExit]):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
* WebProcess/WebPage/mac/WebPageMac.mm:
* WebProcess/cocoa/WebProcessCocoa.mm:

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (252174 => 252175)


--- trunk/Source/WebCore/ChangeLog	2019-11-07 06:37:33 UTC (rev 252174)
+++ trunk/Source/WebCore/ChangeLog	2019-11-07 07:03:17 UTC (rev 252175)
@@ -1,3 +1,15 @@
+2019-11-06  Eric Liang  <[email protected]>
+
+        AX: WKWebView does not shift Accessibility Focus for Catalyst (203798)
+        https://bugs.webkit.org/show_bug.cgi?id=203798
+
+        Reviewed by Chris Fleizach.
+
+        Changed to use the new cocoa directory instead of macOS only
+
+        * accessibility/mac/AXObjectCacheMac.mm:
+        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+
 2019-11-06  Fujii Hironori  <[email protected]>
 
         WEBCORE_TESTSUPPORT_EXPORT should be used only for WebCoreTestSupport, not for WebCore

Modified: trunk/Source/WebCore/PAL/ChangeLog (252174 => 252175)


--- trunk/Source/WebCore/PAL/ChangeLog	2019-11-07 06:37:33 UTC (rev 252174)
+++ trunk/Source/WebCore/PAL/ChangeLog	2019-11-07 07:03:17 UTC (rev 252175)
@@ -1,3 +1,15 @@
+2019-11-06  Eric Liang  <[email protected]>
+
+        AX: WKWebView does not shift Accessibility Focus for Catalyst (203798)
+        https://bugs.webkit.org/show_bug.cgi?id=203798
+
+        Reviewed by Chris Fleizach.
+
+        Changed the path of NSAccessibilitySPI from Mac to Cocoa
+
+        * PAL.xcodeproj/project.pbxproj:
+        * pal/spi/cocoa/NSAccessibilitySPI.h: Renamed from Source/WebCore/PAL/pal/spi/mac/NSAccessibilitySPI.h.
+
 2019-11-02  Devin Rousso  <[email protected]>
 
         Web Inspector: Add diagnostic logging for frontend feature usage

Modified: trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj (252174 => 252175)


--- trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj	2019-11-07 06:37:33 UTC (rev 252174)
+++ trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj	2019-11-07 07:03:17 UTC (rev 252175)
@@ -418,6 +418,7 @@
 				0C5AF9121F43A4C7002EAC02 /* LaunchServicesSPI.h */,
 				1CC3ACE722BD7EB800F360F0 /* MetalSPI.h */,
 				0C2DA12D1F3BEB4900DBC317 /* NEFilterSourceSPI.h */,
+				0C7785741F45130F00F4EBB6 /* NSAccessibilitySPI.h */,
 				0C2DA12E1F3BEB4900DBC317 /* NSAttributedStringSPI.h */,
 				0C2DA12F1F3BEB4900DBC317 /* NSButtonCellSPI.h */,
 				0C2DA1301F3BEB4900DBC317 /* NSCalendarDateSPI.h */,
@@ -473,7 +474,6 @@
 				A10265881F56747A00B4C844 /* HIToolboxSPI.h */,
 				0C7785721F45130F00F4EBB6 /* LookupSPI.h */,
 				0C7785731F45130F00F4EBB6 /* MediaRemoteSPI.h */,
-				0C7785741F45130F00F4EBB6 /* NSAccessibilitySPI.h */,
 				1CCEE4F620D8743F0047B097 /* NSAppearanceSPI.h */,
 				0C7785751F45130F00F4EBB6 /* NSApplicationSPI.h */,
 				A1175B4A1F6B2D7E00C4B9F0 /* NSCellSPI.h */,

Copied: trunk/Source/WebCore/PAL/pal/spi/cocoa/NSAccessibilitySPI.h (from rev 252174, trunk/Source/WebCore/PAL/pal/spi/mac/NSAccessibilitySPI.h) (0 => 252175)


--- trunk/Source/WebCore/PAL/pal/spi/cocoa/NSAccessibilitySPI.h	                        (rev 0)
+++ trunk/Source/WebCore/PAL/pal/spi/cocoa/NSAccessibilitySPI.h	2019-11-07 07:03:17 UTC (rev 252175)
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2015 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 USE(APPKIT)
+
+#if USE(APPLE_INTERNAL_SDK)
+
+#import <AppKit/NSAccessibilityRemoteUIElement.h>
+
+#else
+
+@interface NSAccessibilityRemoteUIElement : NSObject
+
++ (void)setRemoteUIApp:(BOOL)flag;
++ (NSData *)remoteTokenForLocalUIElement:(id)localUIElement;
++ (void)registerRemoteUIProcessIdentifier:(pid_t)pid;
++ (void)unregisterRemoteUIProcessIdentifier:(pid_t)pid;
+
+- (id)initWithRemoteToken:(NSData *)remoteToken;
+- (pid_t)processIdentifier;
+- (void)accessibilitySetPresenterProcessIdentifier:(pid_t)presenterPID;
+
+@property (retain) id windowUIElement;
+@property (retain) id topLevelUIElement;
+
+@end
+
+#endif // USE(APPLE_INTERNAL_SDK)
+
+WTF_EXTERN_C_BEGIN
+
+void NSAccessibilityHandleFocusChanged();
+void NSAccessibilityUnregisterUniqueIdForUIElement(id element);
+
+WTF_EXTERN_C_END
+
+#elif PLATFORM(MACCATALYST)
+
+@interface NSObject (NSAccessibilityRemoteUIElement_Private)
+
+- (void)registerRemoteUIProcessIdentifier:(pid_t)pid;
+- (void)unregisterRemoteUIProcessIdentifier:(pid_t)pid;
+
+@end
+
+#endif // USE(APPKIT)

Deleted: trunk/Source/WebCore/PAL/pal/spi/mac/NSAccessibilitySPI.h (252174 => 252175)


--- trunk/Source/WebCore/PAL/pal/spi/mac/NSAccessibilitySPI.h	2019-11-07 06:37:33 UTC (rev 252174)
+++ trunk/Source/WebCore/PAL/pal/spi/mac/NSAccessibilitySPI.h	2019-11-07 07:03:17 UTC (rev 252175)
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2015 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.
- */
-
-#if USE(APPKIT)
-
-#if USE(APPLE_INTERNAL_SDK)
-
-#import <AppKit/NSAccessibilityRemoteUIElement.h>
-
-#else
-
-@interface NSAccessibilityRemoteUIElement : NSObject
-
-+ (void)setRemoteUIApp:(BOOL)flag;
-+ (NSData *)remoteTokenForLocalUIElement:(id)localUIElement;
-+ (void)registerRemoteUIProcessIdentifier:(pid_t)pid;
-+ (void)unregisterRemoteUIProcessIdentifier:(pid_t)pid;
-
-- (id)initWithRemoteToken:(NSData *)remoteToken;
-- (pid_t)processIdentifier;
-- (void)accessibilitySetPresenterProcessIdentifier:(pid_t)presenterPID;
-
-@property (retain) id windowUIElement;
-@property (retain) id topLevelUIElement;
-
-@end
-
-#endif // USE(APPLE_INTERNAL_SDK)
-
-WTF_EXTERN_C_BEGIN
-
-void NSAccessibilityHandleFocusChanged();
-void NSAccessibilityUnregisterUniqueIdForUIElement(id element);
-
-WTF_EXTERN_C_END
-
-#endif // USE(APPKIT)

Modified: trunk/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm (252174 => 252175)


--- trunk/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm	2019-11-07 06:37:33 UTC (rev 252174)
+++ trunk/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm	2019-11-07 07:03:17 UTC (rev 252175)
@@ -33,7 +33,7 @@
 #import "AccessibilityTable.h"
 #import "RenderObject.h"
 #import "WebAccessibilityObjectWrapperMac.h"
-#import <pal/spi/mac/NSAccessibilitySPI.h>
+#import <pal/spi/cocoa/NSAccessibilitySPI.h>
 
 #if USE(APPLE_INTERNAL_SDK)
 #include <ApplicationServices/ApplicationServicesPriv.h>

Modified: trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (252174 => 252175)


--- trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm	2019-11-07 06:37:33 UTC (rev 252174)
+++ trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm	2019-11-07 07:03:17 UTC (rev 252175)
@@ -76,8 +76,8 @@
 #import "TextIterator.h"
 #import "VisibleUnits.h"
 #import "WebCoreFrameView.h"
+#import <pal/spi/cocoa/NSAccessibilitySPI.h>
 #import <pal/spi/mac/HIServicesSPI.h>
-#import <pal/spi/mac/NSAccessibilitySPI.h>
 #import <wtf/ObjCRuntimeExtras.h>
 #if ENABLE(TREE_DEBUGGING) || ENABLE(METER_ELEMENT)
 #import <wtf/text/StringBuilder.h>

Modified: trunk/Source/WebKit/ChangeLog (252174 => 252175)


--- trunk/Source/WebKit/ChangeLog	2019-11-07 06:37:33 UTC (rev 252174)
+++ trunk/Source/WebKit/ChangeLog	2019-11-07 07:03:17 UTC (rev 252175)
@@ -1,3 +1,29 @@
+2019-11-06  Eric Liang  <[email protected]>
+
+        AX: WKWebView does not shift Accessibility Focus for Catalyst (203798)
+        https://bugs.webkit.org/show_bug.cgi?id=203798
+
+        Reviewed by Chris Fleizach.
+
+        Added the code to register/unregister remote UI Process identifier on the host app.
+        This is used so that the host app can appear as the sender for notifications sent from its web processes. Unfortunately this has to be done in WebKit: in accessibility bundles the swizzled code is not called because of bundle loading time.
+        Added AppKit softlink for Mac catalyst.
+
+        * SourcesCocoa.txt:
+        * UIProcess/Cocoa/WebViewImpl.mm:
+        * UIProcess/ios/AppKitSoftLink.h: Added.
+        * UIProcess/ios/AppKitSoftLink.mm: Added.
+        * UIProcess/ios/ViewGestureControllerIOS.mm:
+        (-[WKSwipeTransitionController gestureRecognizerForInteractiveTransition:WithTarget:action:]):
+        * UIProcess/ios/WKContentView.mm:
+        (-[WKContentView _updateRemoteAccessibilityRegistration:]):
+        (-[WKContentView _accessibilityRegisterUIProcessTokens]):
+        (-[WKContentView _processDidExit]):
+        * WebKit.xcodeproj/project.pbxproj:
+        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
+        * WebProcess/WebPage/mac/WebPageMac.mm:
+        * WebProcess/cocoa/WebProcessCocoa.mm:
+
 2019-11-06  Keith Rollin  <[email protected]>
 
         Update availability annotations to match the macOS 10.15 and iOS 13.0 GM SDKs

Modified: trunk/Source/WebKit/SourcesCocoa.txt (252174 => 252175)


--- trunk/Source/WebKit/SourcesCocoa.txt	2019-11-07 06:37:33 UTC (rev 252174)
+++ trunk/Source/WebKit/SourcesCocoa.txt	2019-11-07 07:03:17 UTC (rev 252175)
@@ -405,6 +405,7 @@
 UIProcess/ios/fullscreen/WKFullScreenViewController.mm
 UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm
 
+UIProcess/ios/AppKitSoftLink.mm
 UIProcess/ios/DragDropInteractionState.mm
 UIProcess/ios/EditableImageController.mm
 UIProcess/ios/InputViewUpdateDeferrer.mm

Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm (252174 => 252175)


--- trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm	2019-11-07 06:37:33 UTC (rev 252174)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm	2019-11-07 07:03:17 UTC (rev 252175)
@@ -106,10 +106,10 @@
 #import <WebCore/WebPlaybackControlsManager.h>
 #import <pal/spi/cg/CoreGraphicsSPI.h>
 #import <pal/spi/cocoa/AVKitSPI.h>
+#import <pal/spi/cocoa/NSAccessibilitySPI.h>
 #import <pal/spi/cocoa/NSTouchBarSPI.h>
 #import <pal/spi/mac/DataDetectorsSPI.h>
 #import <pal/spi/mac/LookupSPI.h>
-#import <pal/spi/mac/NSAccessibilitySPI.h>
 #import <pal/spi/mac/NSApplicationSPI.h>
 #import <pal/spi/mac/NSImmediateActionGestureRecognizerSPI.h>
 #import <pal/spi/mac/NSScrollerImpSPI.h>

Added: trunk/Source/WebKit/UIProcess/ios/AppKitSoftLink.h (0 => 252175)


--- trunk/Source/WebKit/UIProcess/ios/AppKitSoftLink.h	                        (rev 0)
+++ trunk/Source/WebKit/UIProcess/ios/AppKitSoftLink.h	2019-11-07 07:03:17 UTC (rev 252175)
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2014-2016 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 PLATFORM(MACCATALYST)
+
+#import <wtf/SoftLinking.h>
+
+SOFT_LINK_FRAMEWORK_FOR_HEADER(WebKit, AppKit)
+SOFT_LINK_CLASS_FOR_HEADER(WebKit, NSAccessibilityRemoteUIElement)
+
+#endif

Added: trunk/Source/WebKit/UIProcess/ios/AppKitSoftLink.mm (0 => 252175)


--- trunk/Source/WebKit/UIProcess/ios/AppKitSoftLink.mm	                        (rev 0)
+++ trunk/Source/WebKit/UIProcess/ios/AppKitSoftLink.mm	2019-11-07 07:03:17 UTC (rev 252175)
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2014-2016 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.
+ */
+
+#import "config.h"
+
+#if PLATFORM(MACCATALYST)
+
+#import <wtf/SoftLinking.h>
+
+SOFT_LINK_FRAMEWORK_FOR_SOURCE(WebKit, AppKit)
+SOFT_LINK_CLASS_FOR_SOURCE(WebKit, AppKit, NSAccessibilityRemoteUIElement)
+
+#endif

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentView.mm (252174 => 252175)


--- trunk/Source/WebKit/UIProcess/ios/WKContentView.mm	2019-11-07 06:37:33 UTC (rev 252174)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentView.mm	2019-11-07 07:03:17 UTC (rev 252175)
@@ -63,9 +63,11 @@
 #import <WebCore/RuntimeApplicationChecks.h>
 #import <WebCore/VelocityData.h>
 #import <objc/message.h>
+#import <pal/spi/cocoa/NSAccessibilitySPI.h>
 #import <pal/spi/cocoa/QuartzCoreSPI.h>
 #import <wtf/RetainPtr.h>
 #import <wtf/text/TextStream.h>
+#import "AppKitSoftLink.h"
 
 
 @interface WKInspectorIndicationView : UIView
@@ -516,6 +518,25 @@
     objc_setAssociatedObject(element, (void*)[@"ax-machport" hash], @(sendPort), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
 }
 
+
+- (void)_updateRemoteAccessibilityRegistration:(BOOL)registerProcess
+{
+#if PLATFORM(MACCATALYST)
+    pid_t pid = 0;
+    if (registerProcess)
+        pid = _page->process().processIdentifier();
+    else
+        pid = [objc_getAssociatedObject(self, (void*)[@"ax-pid" hash]) intValue];
+    if (!pid)
+        return;
+
+    if (registerProcess)
+        [WebKit::getNSAccessibilityRemoteUIElementClass() registerRemoteUIProcessIdentifier:pid];
+    else
+        [WebKit::getNSAccessibilityRemoteUIElementClass() unregisterRemoteUIProcessIdentifier:pid];
+#endif
+}
+
 - (void)_accessibilityRegisterUIProcessTokens
 {
     auto uuid = [NSUUID UUID];
@@ -523,6 +544,7 @@
 
     // Store information about the WebProcess that can later be retrieved by the iOS Accessibility runtime.
     if (_page->process().state() == WebKit::WebProcessProxy::State::Running) {
+        [self _updateRemoteAccessibilityRegistration:YES];
         IPC::Connection* connection = _page->process().connection();
         storeAccessibilityRemoteConnectionInformation(self, _page->process().processIdentifier(), connection->identifier().port, uuid);
 
@@ -545,6 +567,7 @@
 
 - (void)_processDidExit
 {
+    [self _updateRemoteAccessibilityRegistration:NO];
     [self cleanupInteraction];
 
     [self setShowingInspectorIndication:NO];

Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (252174 => 252175)


--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2019-11-07 06:37:33 UTC (rev 252174)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2019-11-07 07:03:17 UTC (rev 252175)
@@ -86,6 +86,7 @@
 		07297F9F1C17BBEA003F0735 /* UserMediaPermissionCheckProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 07297F9D1C17BBEA003F0735 /* UserMediaPermissionCheckProxy.h */; };
 		07297F9F1C17BBEA015F0735 /* DeviceIdHashSaltStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 07297F9D1C17BBEA223F0735 /* DeviceIdHashSaltStorage.h */; };
 		07297FA31C186ADB003F0735 /* WKUserMediaPermissionCheck.h in Headers */ = {isa = PBXBuildFile; fileRef = 07297FA11C186ADB003F0735 /* WKUserMediaPermissionCheck.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		074879B92373A90900F5678E /* AppKitSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 074879B72373A90900F5678E /* AppKitSoftLink.h */; };
 		074E75FE1DF2211900D318EC /* UserMediaProcessManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 074E75FB1DF1FD1300D318EC /* UserMediaProcessManager.h */; };
 		076E884E1A13CADF005E90FC /* APIContextMenuClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 076E884D1A13CADF005E90FC /* APIContextMenuClient.h */; };
 		0772811D21234FF600C8EF2E /* UserMediaPermissionRequestManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A410F4319AF7B27002EBAB5 /* UserMediaPermissionRequestManager.h */; };
@@ -1959,6 +1960,8 @@
 		07297F9D1C17BBEA223F0735 /* DeviceIdHashSaltStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceIdHashSaltStorage.h; sourceTree = "<group>"; };
 		07297FA01C186ADB003F0735 /* WKUserMediaPermissionCheck.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKUserMediaPermissionCheck.cpp; sourceTree = "<group>"; };
 		07297FA11C186ADB003F0735 /* WKUserMediaPermissionCheck.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKUserMediaPermissionCheck.h; sourceTree = "<group>"; };
+		074879B72373A90900F5678E /* AppKitSoftLink.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = AppKitSoftLink.h; path = ios/AppKitSoftLink.h; sourceTree = "<group>"; };
+		074879B82373A90900F5678E /* AppKitSoftLink.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = AppKitSoftLink.mm; path = ios/AppKitSoftLink.mm; sourceTree = "<group>"; };
 		074E75FB1DF1FD1300D318EC /* UserMediaProcessManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserMediaProcessManager.h; sourceTree = "<group>"; };
 		074E75FC1DF2002400D318EC /* UserMediaProcessManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserMediaProcessManager.cpp; sourceTree = "<group>"; };
 		074E76001DF7075D00D318EC /* MediaDeviceSandboxExtensions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaDeviceSandboxExtensions.cpp; sourceTree = "<group>"; };
@@ -6102,6 +6105,8 @@
 				A115DC6E191D82AB00DA8072 /* _WKWebViewPrintFormatter.h */,
 				A115DC6D191D82AB00DA8072 /* _WKWebViewPrintFormatter.mm */,
 				A19DD3BF1D07D16800AC823B /* _WKWebViewPrintFormatterInternal.h */,
+				074879B72373A90900F5678E /* AppKitSoftLink.h */,
+				074879B82373A90900F5678E /* AppKitSoftLink.mm */,
 				1AD4C1911B39F33200ABC28E /* ApplicationStateTracker.h */,
 				1AD4C1901B39F33200ABC28E /* ApplicationStateTracker.mm */,
 				F496A42F1F58A272004C1757 /* DragDropInteractionState.h */,
@@ -9449,6 +9454,7 @@
 				577FF7822346E81C004EDFB9 /* APIWebAuthenticationPanelClient.h in Headers */,
 				1AE286841C7F93860069AC4F /* APIWebsiteDataRecord.h in Headers */,
 				1A6563E51B7A8C50009CF787 /* APIWindowFeatures.h in Headers */,
+				074879B92373A90900F5678E /* AppKitSoftLink.h in Headers */,
 				F48D2A8521583A7E00C6752B /* AppKitSPI.h in Headers */,
 				F4EC94E32356CC57000BB614 /* ApplicationServicesSPI.h in Headers */,
 				1AD4C1931B39F33200ABC28E /* ApplicationStateTracker.h in Headers */,

Modified: trunk/Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm (252174 => 252175)


--- trunk/Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm	2019-11-07 06:37:33 UTC (rev 252174)
+++ trunk/Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm	2019-11-07 07:03:17 UTC (rev 252175)
@@ -45,7 +45,7 @@
 #import <WebCore/ScrollView.h>
 #import <WebCore/Scrollbar.h>
 #import <WebCore/WebAccessibilityObjectWrapperMac.h>
-#import <pal/spi/mac/NSAccessibilitySPI.h>
+#import <pal/spi/cocoa/NSAccessibilitySPI.h>
 #import <wtf/ObjCRuntimeExtras.h>
 
 

Modified: trunk/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm (252174 => 252175)


--- trunk/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm	2019-11-07 06:37:33 UTC (rev 252174)
+++ trunk/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm	2019-11-07 07:03:17 UTC (rev 252175)
@@ -90,7 +90,7 @@
 #import <WebCore/TextIterator.h>
 #import <WebCore/VisibleUnits.h>
 #import <WebCore/WindowsKeyboardCodes.h>
-#import <pal/spi/mac/NSAccessibilitySPI.h>
+#import <pal/spi/cocoa/NSAccessibilitySPI.h>
 #import <wtf/SetForScope.h>
 
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)

Modified: trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (252174 => 252175)


--- trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2019-11-07 06:37:33 UTC (rev 252174)
+++ trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2019-11-07 07:03:17 UTC (rev 252175)
@@ -71,9 +71,9 @@
 #import <pal/spi/cf/CFUtilitiesSPI.h>
 #import <pal/spi/cg/CoreGraphicsSPI.h>
 #import <pal/spi/cocoa/LaunchServicesSPI.h>
+#import <pal/spi/cocoa/NSAccessibilitySPI.h>
 #import <pal/spi/cocoa/QuartzCoreSPI.h>
 #import <pal/spi/cocoa/pthreadSPI.h>
-#import <pal/spi/mac/NSAccessibilitySPI.h>
 #import <pal/spi/mac/NSApplicationSPI.h>
 #import <stdio.h>
 #import <wtf/FileSystem.h>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to