Skip to content

Commit

Permalink
REGRESSION (251473@main): [watchOS] Crash when focusing an input fiel…
Browse files Browse the repository at this point in the history
…d with spellcheck="false"

https://bugs.webkit.org/show_bug.cgi?id=242364
rdar://96458889

Reviewed by Aditya Keerthi.

Add a missing `-respondsToSelector:` check before attempting to set `spellCheckingType`. `spellCheckingType` is an
optional property on the `UITextInputTraits` protocol, and (importantly) isn't implemented on watchOS.

This crash is already exercised by `fast/forms/watchos/enter-text-with-spellcheck-disabled.html`, which (unfortunately)
doesn't run in pre- or post-commit non-internal automation.

* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _updateTextInputTraits:]):

Canonical link: https://commits.webkit.org/252166@main
  • Loading branch information
whsieh committed Jul 6, 2022
1 parent 92b574e commit 23bcedb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
Original file line number Diff line number Diff line change
Expand Up @@ -5926,7 +5926,8 @@ - (void)_updateTextInputTraits:(id <UITextInputTraits>)traits
traits.smartQuotesType = UITextSmartQuotesTypeNo;
if ([traits respondsToSelector:@selector(setSmartDashesType:)])
traits.smartDashesType = UITextSmartDashesTypeNo;
traits.spellCheckingType = UITextSpellCheckingTypeNo;
if ([traits respondsToSelector:@selector(setSpellCheckingType:)])
traits.spellCheckingType = UITextSpellCheckingTypeNo;
}

switch (_focusedElementInformation.inputMode) {
Expand Down

0 comments on commit 23bcedb

Please sign in to comment.