[webkit-changes] [WebKit/WebKit] 674f7d: [iOS 17.4] Blink crashes on launch due to an unrec...

Wenson Hsieh noreply at github.com
Fri Feb 2 21:48:58 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 674f7d1c60a7a5d386ffb4fc8e40621ecd5e0dc4
      https://github.com/WebKit/WebKit/commit/674f7d1c60a7a5d386ffb4fc8e40621ecd5e0dc4
  Author: Wenson Hsieh <wenson_hsieh at apple.com>
  Date:   2024-02-02 (Fri, 02 Feb 2024)

  Changed paths:
    M Source/WebKit/UIProcess/ios/WKExtendedTextInputTraits.h
    M Source/WebKit/UIProcess/ios/WKExtendedTextInputTraits.mm
    M Tools/TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm

  Log Message:
  -----------
  [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




More information about the webkit-changes mailing list