[webkit-changes] [WebKit/WebKit] db2541: [iOS] -setSelectedTextRange: crashes with a nil ra...

Wenson Hsieh noreply at github.com
Fri Jan 5 19:07:19 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: db2541f704074d51642b6a6eada42ede259496b5
      https://github.com/WebKit/WebKit/commit/db2541f704074d51642b6a6eada42ede259496b5
  Author: Wenson Hsieh <wenson_hsieh at apple.com>
  Date:   2024-01-05 (Fri, 05 Jan 2024)

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

  Log Message:
  -----------
  [iOS] -setSelectedTextRange: crashes with a nil range when async text input is enabled
https://bugs.webkit.org/show_bug.cgi?id=267164
rdar://120553527

Reviewed by Aditya Keerthi.

Ensure that we don't hit legacy UIKit method assertions from within our own code, when async text
input is enabled, by moving the logic in `clearSelection` into `_internalClearSelection`, limiting
the assertion to `clearSelection`, and then using `_internalClearSelection` instead of the former.

Test: KeyboardInputTests.ClearSelectedTextRange

* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView clearSelection]):
(-[WKContentView _internalClearSelection]):
(-[WKContentView setSelectedTextRange:]):
* Tools/TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm:

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




More information about the webkit-changes mailing list