Changeset 273298 in webkit


Ignore:
Timestamp:
Feb 22, 2021 7:50:54 PM (3 years ago)
Author:
rniwa@webkit.org
Message:

REGRESSION (r272928): ASSERT NOT REACHED in WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance
https://bugs.webkit.org/show_bug.cgi?id=222219
<rdar://problem/74548257>

Reviewed by Wenson Hsieh.

The assertion failure was caused by confirmCompositionAndNotifyClient called in commitProvisionalLoad
committing the composition even though the composition node had been removed from the document.

Fixed the bug by canceling the composition if the composition node had been removed or the selection
had been moved away from it in confirmCompositionAndNotifyClient.

Test: editing/input/select-all-clear-input-method.html

  • editing/Editor.cpp:

(WebCore::Editor::confirmOrCancelCompositionAndNotifyClient): Renamed from confirmCompositionAndNotifyClient.

  • editing/Editor.h:
  • loader/FrameLoader.cpp:

(WebCore::FrameLoader::commitProvisionalLoad):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r273296 r273298  
     12021-02-22  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        REGRESSION (r272928): ASSERT NOT REACHED in WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance
     4        https://bugs.webkit.org/show_bug.cgi?id=222219
     5        <rdar://problem/74548257>
     6
     7        Reviewed by Wenson Hsieh.
     8
     9        The assertion failure was caused by confirmCompositionAndNotifyClient called in commitProvisionalLoad
     10        committing the composition even though the composition node had been removed from the document.
     11
     12        Fixed the bug by canceling the composition if the composition node had been removed or the selection
     13        had been moved away from it in confirmCompositionAndNotifyClient.
     14
     15        Test: editing/input/select-all-clear-input-method.html
     16
     17        * editing/Editor.cpp:
     18        (WebCore::Editor::confirmOrCancelCompositionAndNotifyClient): Renamed from confirmCompositionAndNotifyClient.
     19        * editing/Editor.h:
     20        * loader/FrameLoader.cpp:
     21        (WebCore::FrameLoader::commitProvisionalLoad):
     22
    1232021-02-22  Wenson Hsieh  <wenson_hsieh@apple.com>
    224
  • trunk/Source/WebCore/editing/Editor.cpp

    r273077 r273298  
    19441944}
    19451945
    1946 void Editor::confirmCompositionAndNotifyClient()
     1946void Editor::confirmOrCancelCompositionAndNotifyClient()
    19471947{
    19481948    if (!hasComposition())
     
    19511951    auto frame = makeRefPtr(m_document.frame());
    19521952    if (!frame)
     1953        return;
     1954
     1955    if (cancelCompositionIfSelectionIsInvalid())
    19531956        return;
    19541957
  • trunk/Source/WebCore/editing/Editor.h

    r271459 r273298  
    380380    WEBCORE_EXPORT void confirmComposition();
    381381    WEBCORE_EXPORT void confirmComposition(const String&); // if no existing composition, replaces selection
    382     void confirmCompositionAndNotifyClient();
     382    void confirmOrCancelCompositionAndNotifyClient();
    383383    WEBCORE_EXPORT void cancelComposition();
    384384    bool cancelCompositionIfSelectionIsInvalid();
  • trunk/Source/WebCore/loader/FrameLoader.cpp

    r272920 r273298  
    19881988        // attempt to confirm any active composition once again in this scenario after we
    19891989        // finish restoring from the cached page.
    1990         document->editor().confirmCompositionAndNotifyClient();
     1990        document->editor().confirmOrCancelCompositionAndNotifyClient();
    19911991    }
    19921992
     
    20692069
    20702070    if (auto document = makeRefPtr(m_frame.document()))
    2071         document->editor().confirmCompositionAndNotifyClient();
     2071        document->editor().confirmOrCancelCompositionAndNotifyClient();
    20722072
    20732073    LOG(Loading, "WebCoreLoading %s: Finished committing provisional load to URL %s", m_frame.tree().uniqueName().string().utf8().data(),
Note: See TracChangeset for help on using the changeset viewer.