[webkit-changes] [WebKit/WebKit] e4ff4c: Unable to show text alternatives when tapping gram...
Wenson Hsieh
noreply at github.com
Sat Jul 8 12:29:43 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: e4ff4c63704ce1768b58e633aec0f12381cd3f25
https://github.com/WebKit/WebKit/commit/e4ff4c63704ce1768b58e633aec0f12381cd3f25
Author: Wenson Hsieh <wenson_hsieh at apple.com>
Date: 2023-07-08 (Sat, 08 Jul 2023)
Changed paths:
A LayoutTests/editing/selection/ios/show-grammar-replacements-on-tap-expected.txt
A LayoutTests/editing/selection/ios/show-grammar-replacements-on-tap.html
M LayoutTests/platform/ios-wk2/TestExpectations
M Source/WebCore/dom/DocumentMarkerController.h
M Source/WebKit/Shared/EditorState.h
M Source/WebKit/Shared/EditorState.serialization.in
M Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
M Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
Log Message:
-----------
Unable to show text alternatives when tapping grammatical error in Mail compose
https://bugs.webkit.org/show_bug.cgi?id=259008
rdar://111404885
Reviewed by Tim Horton and Abrar Rahman Protyasha.
After the changes in 264745 at main, we no longer perform sync IPC underneath
`-requestAutocorrectionContextWithCompletionHandler:`, and instead just return an empty context when
out-of-process keyboard is enabled. This is because UIKit now syncs document state by requesting
`UIWKDocumentContext`s when OOPK is enabled, instead of `UIWKAutocorrectionContext`.
However, there's still one instance where UIKit still depends on the legacy autocorrection context
to drive platform features: the case of showing grammar text checking results when the user taps on
a grammar correction in editable content (i.e. words with blue dotted underlines). Work around this
for the time being by falling back to shipping behavior when grammar corrections are present in the
document; we can remove this once rdar://111936621 is fixed.
* LayoutTests/editing/selection/ios/show-grammar-replacements-on-tap-expected.txt: Added.
* LayoutTests/editing/selection/ios/show-grammar-replacements-on-tap.html: Added.
* LayoutTests/platform/ios-wk2/TestExpectations:
Add a layout test to exercise the fix, building on the infrastructure added in 265869 at main. Note
that we use `runSingly=true` here because otherwise, `UIWKTextInteractionAssistant` might use a
previously initialized and cached `UITextChecker` instance, rather than the `LayoutTestSpellChecker`
that contains the canned text corrections that the test depends on.
* Source/WebCore/dom/DocumentMarkerController.h:
* Source/WebKit/Shared/EditorState.h:
* Source/WebKit/Shared/EditorState.serialization.in:
Add a new bit to `EditorState` here, indicating whether we have grammar markers inside the current
editable root.
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPlatformEditorState const):
Canonical link: https://commits.webkit.org/265880@main
More information about the webkit-changes
mailing list