[webkit-changes] [WebKit/WebKit] 6a0bff: [iOS] Overriding -[WKWebView textInputTraits] no l...

Wenson Hsieh noreply at github.com
Sat Dec 16 20:35:36 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6a0bff521d3a7d30cbdf289850dd561337374f6e
      https://github.com/WebKit/WebKit/commit/6a0bff521d3a7d30cbdf289850dd561337374f6e
  Author: Wenson Hsieh <wenson_hsieh at apple.com>
  Date:   2023-12-16 (Sat, 16 Dec 2023)

  Changed paths:
    M Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
    M Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

  Log Message:
  -----------
  [iOS] Overriding -[WKWebView textInputTraits] no longer works when async text input is enabled
https://bugs.webkit.org/show_bug.cgi?id=266545
rdar://119768117

Reviewed by Megan Gardner.

Ensure binary compatibility with internal clients (e.g. Mail, News) that override the SPI method
`-[WKWebView _textInputTraits]`, to override or customize the private text input traits object. To
do this, we detect whether or not the embedding client overrides `-_textInputTraits`, and fall back
to returning private text input traits (`UITextInputTraits`) in `-extendedTraitsDelegate`, which
consults the embedding client in the process.

We also suppress the async text input assertion in this case. Covered by running the API test
`KeyboardInputTests.OverrideTextInputTraits` when `UIKit/async_text_input` is enabled.

* Source/WebKit/UIProcess/ios/WKContentViewInteraction.h:
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView insertionPointColor]):
(-[WKContentView selectionBarColor]):
(-[WKContentView selectionHighlightColor]):
(-[WKContentView _requiresLegacyTextInputTraits]):
(-[WKContentView textInputTraits]):
(-[WKContentView extendedTraitsDelegate]):
(-[WKContentView textContentTypeForTesting]):

Canonical link: https://commits.webkit.org/272187@main




More information about the webkit-changes mailing list