-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[iOS] Stop conforming to private UIKit ObjC protocols when "Async UIK…
…it Interactions" is enabled https://bugs.webkit.org/show_bug.cgi?id=263813 rdar://117611037 Reviewed by Aditya Keerthi. Refactor UIKit async interaction support: • Rename `HAVE(UI_ASYNC_TEXT_INPUT)` to `HAVE(UI_ASYNC_TEXT_INTERACTION)`, and guard compile-time enablement on the availability of `UIAsyncTextInteraction.h`. This allows us to remain source- compatible with versions of UIKit that have slightly-older versions of `UIAsyncTextInput.h`, that are missing a declaration of `UITextReplacementOptions`. • Stop declaring conformance at compile-time to the following 5 SPI protocols, from UIKit: • `UIWKInteractionViewProtocol` • `UITextInputPrivate` • `UITextAutoscrolling` • `UITextInputMultiDocument` • `UITextInputTranslationSupport` ...and instead, conform to these protocols only when the `UseAsyncUIKitInteractions` internal preference is disabled. • Make this logic run once, immediately upon content view initialization, to limit any risk that any logic that depends on the content view conforming to any of these protocols might be broken after this refactoring. This will put us in a position where we can easily test against versions of UIKit that have system support for `UIAsyncTextInput`, while revealing any interactions or features that might still be relying on the 5 protocols listed above. It also puts us in a better position to completely remove reliance on those protocols once the `UseAsyncUIKitInteractions` preference is enabled by default, simply by removing the logic to establish conformance at runtime. * Source/WTF/wtf/PlatformHave.h: * Source/WebCore/platform/ios/WebEvent.mm: * Source/WebCore/platform/ios/WebEventPrivate.h: * Source/WebKit/Platform/spi/ios/UIKitSPI.h: * Source/WebKit/UIProcess/API/ios/WKWebViewPrivateForTestingIOS.h: * Source/WebKit/UIProcess/API/ios/WKWebViewTestingIOS.mm: (-[WKWebView _requestDocumentContext:completionHandler:]): Deleted. (-[WKWebView _adjustSelectionWithDelta:completionHandler:]): Deleted. (-[WKWebView applyAutocorrection:toString:withCompletionHandler:]): Deleted. (-[WKWebView applyAutocorrection:toString:isCandidate:withCompletionHandler:]): Deleted. * Source/WebKit/UIProcess/ios/WKContentView.mm: (-[WKContentView _commonInitializationWithProcessPool:configuration:]): * Source/WebKit/UIProcess/ios/WKContentViewInteraction.h: * Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _updateRuntimeProtocolConformanceIfNeeded]): (-[WKContentView setUpInteraction]): (-[WKContentView _interpretKeyEvent:isCharEvent:]): (-[WKContentView _ensureBinaryCompatibilityWithAsyncInteractionsIfNeeded]): Deleted. Rename this to `-_updateRuntimeProtocolConformanceIfNeeded`, to better reflect its new role, now that it adds protocol conformance to several legacy UIKit protocols at runtime. * Source/WebKit/WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::dispatchWheelEventWithoutScrolling): * Tools/TestRunnerShared/spi/UIKitSPIForTesting.h: Move the protocol declarations out of `UIKitSPI.h`, and into `UIKitSPIForTesting.h`. * Tools/TestWebKitAPI/Tests/WebKitCocoa/DocumentEditingContext.mm: (-[TestWKWebView synchronouslyRequestDocumentContext:]): (-[TestWKWebView synchronouslyAdjustSelectionWithDelta:]): * Tools/TestWebKitAPI/Tests/ios/AutocorrectionTestsIOS.mm: * Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm: (WTR::UIScriptControllerIOS::applyAutocorrection): Adjust some test infrastructure to stop using the deleted testing hooks, and instead just call into `WKContentView` directly, like most of the other API tests already do. Canonical link: https://commits.webkit.org/270027@main
- Loading branch information
Showing
13 changed files
with
85 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.