-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Occasional crash under WebPage::sendEditorStateUpdate() when discardi…
…ng IME composition https://bugs.webkit.org/show_bug.cgi?id=258942 rdar://111258989 Reviewed by Tim Horton. Address a web content process crash, wherein we attempt to access `Page::m_focusController` once it has already been cleared out. This can occur when a page in the page cache is destroyed, while it still contains an active IME composition (i.e. `Editor::m_compositionNode` is non-null). Mitigate this by only computing and sending an editor state update in this case, if the `Document` containing the marked text range has a living render tree. To do this, we refactor the `discardedComposition` `EditorClient` hook to pass a `const Document&` instead of a `Frame*` (the latter of which ends up being null at this point during page destruction), and use it to return early in `WebPage::discardedComposition` to avoid the crash. Test: KeyboardInputTests.NoCrashWhenDiscardingMarkedText * Source/WebCore/editing/Editor.cpp: (WebCore::Editor::clear): (WebCore::Editor::confirmOrCancelCompositionAndNotifyClient): * Source/WebCore/loader/EmptyClients.cpp: * Source/WebCore/page/EditorClient.h: * Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::discardedComposition): * Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.h: * Source/WebKit/WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didChangeSelectionOrOverflowScrollPosition): (WebKit::WebPage::discardedComposition): * Source/WebKit/WebProcess/WebPage/WebPage.h: * Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.h: * Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm: (WebEditorClient::discardedComposition): * Tools/TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/265821@main
- Loading branch information
Showing
10 changed files
with
49 additions
and
12 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