-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ iOS ] 3x editing/spelling/* (layout-tests) are constant failures #27003
Conversation
EWS run on previous version of this PR (hash 9254368) |
EWS run on current version of this PR (hash 41e070e) |
self.selectionHighlightColor = shouldUseTintColor ? [tintColor colorWithAlphaComponent:selectionHighlightAlphaComponent] : nil; | ||
} | ||
|
||
- (void)restoreDefaultValues |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any risk if the property list in this method gets out-of-date? (I think no, but want to confirm)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right β it would get out of date if we added a new @property
to WKExtendedTextInputTraits
, but didn't update this method as well. That said, I think it's not that easy to make that mistake, as long as whoever's adding the new property searches the existing code for any of the other existing properties, and follows the same precedent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess my question is more specifically: "What would the effect be (if any) if the list were to get out-of-date?".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see. It's pretty unlikely this would user-facing effects even if the list were to get out-of-date, since this would only affect the case where UIKit relies on text input traits outside of text input. The only other trait that falls into this category is selection highlight and handle color (which I made sure to update separately, in this patch), and apparently this autocorrectionType
which influences whether or not continuous spellchecking is enabled.
Thanks for the review! |
https://bugs.webkit.org/show_bug.cgi?id=271864 rdar://125585822 Reviewed by Aditya Keerthi. Among the many other changes to adopt `BETextInput`, iOS 17.4 refactored `WKContentView` to stop relying on the UIKit internal method `-_requiresKeyboardWhenFirstResponder`. Instead, UIKit now returns `YES` when the delegate is a `BETextInput`, as long as either of the following are true: 1. The hardware keyboard is connected. 2. An editable element is focused. However, a consequence of this refactoring is that `WKContentView` now vends text input traits to keyboard code in UIKit when a hardware keyboard is attached, even in the case where there is no focused element. In practice, this doesn't really matter, since these text input traits (which contain `UITextAutocorrectionTypeNo`) are effectively unused. However, in the case of these three layout tests that programmatically focus text inputs, insert text, and expect spellchecking to occur outside of the context of any input session, we end up failing because the spelling corrections are disabled by the traits. To fix this, restore pre-iOS 17.4 behavior by reverting to `WKExtendedTextInputTraits`'s default values when no element is focused (or being focused). Namely, this ensures that the autocorrection type is set to `UITextAutocorrectionTypeDefault`, which matches shipping behavior in the case when the user isn't focusing anything editable, but still enables continuous spellchecking when programmatically inserting text. * LayoutTests/platform/ios/TestExpectations: Mark these layout test as passing again. * Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _updateTextInputTraits:]): (-[WKContentView extendedTraitsDelegate]): See above for more details. * Source/WebKit/UIProcess/ios/WKExtendedTextInputTraits.h: * Source/WebKit/UIProcess/ios/WKExtendedTextInputTraits.mm: (-[WKExtendedTextInputTraits init]): (-[WKExtendedTextInputTraits setSelectionColorsToMatchTintColor:]): (-[WKExtendedTextInputTraits restoreDefaultValues]): Add a new method to restore all default text input traits. (-[WKExtendedTextInputTraits setSelectionBarColor:]): Deleted. (-[WKExtendedTextInputTraits selectionBarColor]): Deleted. Remove some old versions of the `UIAsyncTextInput` implementation that are no longer necessary, since they've all been superceded by `BETextInput`. Canonical link: https://commits.webkit.org/277233@main
41e070e
to
697b1a8
Compare
Committed 277233@main (697b1a8): https://commits.webkit.org/277233@main Reviewed commits have been landed. Closing PR #27003 and removing active labels. |
697b1a8
41e070e