Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace
-layoutHasChanged
and -updateForChangedSelection
with `-[…
…UIAsyncTextInputDelegate invalidateTextEntryContext]` https://bugs.webkit.org/show_bug.cgi?id=265054 rdar://118467892 Reviewed by Megan Gardner. Adopt `-[UIAsyncTextInputDelegate invalidateTextEntryContext]`, which is a direct replacement for `-[UIKeyboardImpl updateForChangedSelection]`. Since the latter also updates marked text UI if needed, we can also replace the `-layoutHasChanged` call with this new method as well. * Source/WebKit/Platform/spi/ios/UIKitSPI.h: * Source/WebKit/UIProcess/ios/WKContentViewInteraction.h: * Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm: (-[WKRelativeTextRange isEmpty]): Some drive-by fixes after the introduction of `WKRelativeTextRange` in 270847@main: 1. Enforce type safety in `-selectionRectsForRange:` and `-caretRectForPosition:`, in case any system client calls these methods using a relative range. 2. Fix `-[WKRelativeTextRange isEmpty]` so that it returns `YES` only in the case where the offsets are equal, *and* the anchors are the same. 3. Return `nil` in `-positionFromPosition:offset:` and `-textRangeFromPosition:toPosition:` instead of `WKRelativeText{Range|Position}`, if the given positions are either not already relative to the selection, or the given positions are not identical to the selection start/end. This is possible if UIKit asks for `-markedTextRange`, and then asks for positions offset from the start or end of the marked text. (-[WKContentView replaceForWebView:]): Another drive-by fix: the plan for handling `-replace:` has pivoted slightly, such that we're going to instead call a new protocol method on the sytem input delegate, instead of calling into the superclass. Adjust for that here. (-[WKContentView caretRectForPosition:]): (-[WKContentView selectionRectsForRange:]): (-[WKContentView _isAnchoredToCurrentSelection:]): (-[WKContentView textRangeFromPosition:toPosition:]): (-[WKContentView positionFromPosition:offset:]): (-[WKContentView _updateInputContextAfterBlurringAndRefocusingElement]): (-[WKContentView _selectionChanged]): (-[WKContentView setAsyncSystemInputDelegate:]): Canonical link: https://commits.webkit.org/270918@main
- Loading branch information