⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 277202 in webkit


Ignore:
Timestamp:
May 7, 2021, 2:54:02 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Do not try to remove and already removed node while deleting selection
​https://bugs.webkit.org/show_bug.cgi?id=224893

Patch by Carlos Garcia Campos <​cgarcia@igalia.com> on 2021-05-07
Reviewed by Ryosuke Niwa.

Source/WebCore:

Test: editing/inserting/insert-text-force-repaint-on-load-crash.html

  • editing/DeleteSelectionCommand.cpp:

(WebCore::DeleteSelectionCommand::removeNode): Return early if the given node doesn't have a parent anymore.

Tools:

Add new API to allow tests to trigger a force repaint on load finished.

  • WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
  • WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:

(WTR::InjectedBundlePage::frameDidChangeLocation):

  • WebKitTestRunner/InjectedBundle/TestRunner.h:

(WTR::TestRunner::displayOnLoadFinish):
(WTR::TestRunner::shouldDisplayOnLoadFinish):

LayoutTests:

  • editing/inserting/insert-text-force-repaint-on-load-crash-expected.txt: Added.
  • editing/inserting/insert-text-force-repaint-on-load-crash.html: Added.
Location:
trunk
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r277200 r277202  
     12021-05-07  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        Do not try to remove and already removed node while deleting selection
     4        https://bugs.webkit.org/show_bug.cgi?id=224893
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        * editing/inserting/insert-text-force-repaint-on-load-crash-expected.txt: Added.
     9        * editing/inserting/insert-text-force-repaint-on-load-crash.html: Added.
     10
    1112021-05-07  Robert Jenner  <jenner@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r277196 r277202  
     12021-05-07  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        Do not try to remove and already removed node while deleting selection
     4        https://bugs.webkit.org/show_bug.cgi?id=224893
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Test: editing/inserting/insert-text-force-repaint-on-load-crash.html
     9
     10        * editing/DeleteSelectionCommand.cpp:
     11        (WebCore::DeleteSelectionCommand::removeNode): Return early if the given node doesn't have a parent anymore.
     12
    1132021-05-07  Wenson Hsieh  <wenson_hsieh@apple.com>
    214
  • trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp

    r277163 r277202  
    512512void DeleteSelectionCommand::removeNode(Node& node, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable)
    513513{
     514    if (!node.parentNode())
     515        return;
     516
    514517    Ref<Node> protectedNode = node;
    515518    if (m_startRoot != m_endRoot && !(node.isDescendantOf(m_startRoot.get()) && node.isDescendantOf(m_endRoot.get()))) {
  • trunk/Tools/ChangeLog

    r277201 r277202  
     12021-05-07  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        Do not try to remove and already removed node while deleting selection
     4        https://bugs.webkit.org/show_bug.cgi?id=224893
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Add new API to allow tests to trigger a force repaint on load finished.
     9
     10        * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
     11        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
     12        (WTR::InjectedBundlePage::frameDidChangeLocation):
     13        * WebKitTestRunner/InjectedBundle/TestRunner.h:
     14        (WTR::TestRunner::displayOnLoadFinish):
     15        (WTR::TestRunner::shouldDisplayOnLoadFinish):
     16
    1172021-05-07  Brent Fulgham  <bfulgham@apple.com>
    218
  • trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl

    r276853 r277202  
    114114    undefined display();
    115115    undefined displayAndTrackRepaints();
     116    undefined displayOnLoadFinish();
    116117
    117118    // Failed load condition testing
  • trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp

    r273966 r277202  
    18611861    injectedBundle.setTopLoadingFrame(nullptr);
    18621862
     1863    if (injectedBundle.testRunner()->shouldDisplayOnLoadFinish()) {
     1864        if (auto page = InjectedBundle::singleton().page())
     1865            WKBundlePageForceRepaint(page->page());
     1866    }
     1867
    18631868    if (injectedBundle.testRunner()->shouldWaitUntilDone())
    18641869        return;
  • trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h

    r276853 r277202  
    129129    void display();
    130130    void displayAndTrackRepaints();
     131    void displayOnLoadFinish() { m_displayOnLoadFinish = true; }
     132    bool shouldDisplayOnLoadFinish() { return m_displayOnLoadFinish; }
    131133
    132134    // UserContent testing.
    … …  
    576578    bool m_testRepaint { false };
    577579    bool m_testRepaintSweepHorizontally { false };
     580    bool m_displayOnLoadFinish { false };
    578581    bool m_isPrinting { false };
    579582    bool m_willSendRequestReturnsNull { false };
Note: See TracChangeset for help on using the changeset viewer.