Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[iOS 17.4] Blink crashes on launch due to an unrecognized selector on…
… WKExtendedTextInputTraits https://bugs.webkit.org/show_bug.cgi?id=268667 rdar://122025854 Reviewed by Tim Horton. Maintain binary compatibility with third party apps that reach into `WKContentView`'s internal text input traits object, and expect it to implement all the API methods on `UITextInputTraits`. This was previously the case when async text input was disabled, because the internal text input traits would be a concrete `UITextInputTraits` instance which implements all of the optional properties (as well as all the properties on `UITextInputTraits_Private`). We lost this when implementing our own `WKExtendedTextInputTraits` that implements the new `BEExtendedTextInputTraits` protocol from BrowserEngineKit, since this new class only implements the properties that we internally set in WebKit, along with the new extended traits. We should instead ensure binary compatibility when using `WKExtendedTextInputTraits` by (at least) implementing all of the optional properties on `UITextInputTraits` and `WKExtendedTextInputTraits`, and ensuring that they have default values that mostly* match the default values described in `<UIKit/UITextInputTraits.h>`. Test: KeyboardInputTests.ImplementAllOptionalTextInputTraits * Source/WebKit/UIProcess/ios/WKExtendedTextInputTraits.h: * Source/WebKit/UIProcess/ios/WKExtendedTextInputTraits.mm: (-[WKExtendedTextInputTraits init]): (-[WKExtendedTextInputTraits setPasswordRules:]): (-[WKExtendedTextInputTraits passwordRules]): (-[WKExtendedTextInputTraits textContentType]): * Tools/TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm: Add a test that sanity checks all public properties on our text input traits and verifies that the default values are consistent with UIKit/BrowserEngineKit documentation. * Note that this test intentionally leaves out `inlinePredictionType` and `autocorrectionType`, since those both have default values in WebKit that are `no`. It's unclear if this is intentional, but I'm leaving this behavior intact for now. Canonical link: https://commits.webkit.org/274035@main
- Loading branch information