Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[WK2] Data interaction tests occasionally hit assertions in debug builds
https://bugs.webkit.org/show_bug.cgi?id=169002 <rdar://problem/30994806> Reviewed by Tim Horton. Source/WebCore: Data interaction unit tests occasionally fail due to the UI process expecting the latest received EditorState to contain post layout data, but finding that it does not in -[WKContentView selectedTextRange]. The incomplete EditorStates in question are sent while performing a data interaction operation, due to transient changes in the frame selection. The UI process does not need to (and should not) be informed of these selection changes at all. We can fix this by preventing the editor client from responding to selection changes during data interaction operation. This patch also renames setIgnoreCompositionSelectionChange to setIgnoreSelectionChanges to better reflect the fact that it is used outside of the context of holding selection change updates during IME. We already use this affordance in various places, such as TextIndicator (while taking a snapshot on iOS), in FindController on iOS, and when replacing selected or dictated text. Additionally, there is no logic in setIgnoreCompositionSelectionChange that limits its use to composition. * editing/Editor.cpp: (WebCore::Editor::cancelCompositionIfSelectionIsInvalid): (WebCore::Editor::setComposition): (WebCore::Editor::revealSelectionAfterEditingOperation): (WebCore::Editor::setIgnoreSelectionChanges): (WebCore::Editor::changeSelectionAfterCommand): (WebCore::Editor::respondToChangedSelection): (WebCore::Editor::setIgnoreCompositionSelectionChange): Deleted. * editing/Editor.h: (WebCore::Editor::ignoreSelectionChanges): (WebCore::Editor::ignoreCompositionSelectionChange): Deleted. * editing/mac/EditorMac.mm: (WebCore::Editor::selectionWillChange): * page/TextIndicator.cpp: (WebCore::TextIndicator::createWithRange): Source/WebKit/mac: Renames setIgnoreCompositionSelectionChange to setIgnoreSelectionChanges. See WebCore ChangeLog for more details. * WebView/WebHTMLView.mm: (-[WebHTMLView _updateSelectionForInputManager]): * WebView/WebView.mm: (-[WebView updateTextTouchBar]): Source/WebKit2: Renames setIgnoreCompositionSelectionChange to setIgnoreSelectionChanges. See WebCore ChangeLog for more details. * Shared/EditorState.cpp: (WebKit::EditorState::encode): (WebKit::EditorState::decode): * Shared/EditorState.h: * UIProcess/gtk/WebPageProxyGtk.cpp: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::editorStateChanged): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::editorStateChanged): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::editorState): (WebKit::WebPage::performDragControllerAction): (WebKit::WebPage::setComposition): (WebKit::WebPage::didChangeSelection): * WebProcess/WebPage/ios/FindControllerIOS.mm: (WebKit::setSelectionChangeUpdatesEnabledInAllFrames): (WebKit::FindController::willFindString): (WebKit::FindController::didFailToFindString): (WebKit::FindController::didHideFindIndicator): (WebKit::setCompositionSelectionChangeEnabledInAllFrames): Deleted. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::updateSelectionAppearance): (WebKit::WebPage::replaceSelectedText): (WebKit::WebPage::replaceDictatedText): Tools: Reenables and refactors data interaction tests. * TestWebKitAPI/Tests/ios/DataInteractionTests.mm: * TestWebKitAPI/ios/DataInteractionSimulator.h: * TestWebKitAPI/ios/DataInteractionSimulator.mm: (-[DataInteractionSimulator _resetSimulatedState]): (-[DataInteractionSimulator runFrom:to:]): (-[DataInteractionSimulator _advanceProgress]): Canonical link: https://commits.webkit.org/186596@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213902 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
21 changed files
with
160 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.