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

Changeset 276546 in webkit


Ignore:
Timestamp:
Apr 23, 2021, 11:11:00 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Crash in IndentOutdentCommand::outdentParagraph attempting to move a paragraph
https://bugs.webkit.org/show_bug.cgi?id=224909

Patch by Ian Gilbert <iang@apple.com> on 2021-04-23
Reviewed by Ryosuke Niwa.

Added check inside IndentOutdentCommand::outdentParagraph to ensure that inserting a
HTMLBRElement was successful before attempting to move a paragraph to that node.

  • editing/IndentOutdentCommand.cpp:

(WebCore::IndentOutdentCommand::outdentParagraph):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r276530 r276546  
     12021-04-23  Ian Gilbert  <iang@apple.com>
     2
     3        Crash in IndentOutdentCommand::outdentParagraph attempting to move a paragraph
     4        https://bugs.webkit.org/show_bug.cgi?id=224909
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Added check inside IndentOutdentCommand::outdentParagraph to ensure that inserting a
     9        HTMLBRElement was successful before attempting to move a paragraph to that node.
     10
     11        * editing/IndentOutdentCommand.cpp:
     12        (WebCore::IndentOutdentCommand::outdentParagraph):
     13
    1142021-04-23  Ryosuke Niwa  <rniwa@webkit.org>
    215
  • trunk/Source/WebCore/editing/IndentOutdentCommand.cpp

    r266557 r276546  
    192192    }
    193193    auto placeholder = HTMLBRElement::create(document());
    194     auto* placeholderPtr = placeholder.ptr();
    195     insertNodeBefore(WTFMove(placeholder), *splitBlockquoteNode);
    196     moveParagraph(startOfParagraph(visibleStartOfParagraph), endOfParagraph(visibleEndOfParagraph), positionBeforeNode(placeholderPtr), true);
     194    insertNodeBefore(placeholder, *splitBlockquoteNode);
     195    if (placeholder->isConnected())
     196        moveParagraph(startOfParagraph(visibleStartOfParagraph), endOfParagraph(visibleEndOfParagraph), positionBeforeNode(placeholder.ptr()), true);
    197197}
    198198
Note: See TracChangeset for help on using the changeset viewer.