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

Changeset 274131 in webkit


Ignore:
Timestamp:
Mar 8, 2021, 7:41:33 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Crash in in ReplaceSelectionCommand::mergeEndIfNeeded()
https://bugs.webkit.org/show_bug.cgi?id=222941

Patch by Julian Gonzalez <julian_a_gonzalez@apple.com> on 2021-03-08
Reviewed by Ryosuke Niwa.

Make a copy of Ref<HTMLBRElement> when inserting before start of paragraph.

  • editing/ReplaceSelectionCommand.cpp:

(WebCore::ReplaceSelectionCommand::mergeEndIfNeeded):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r274115 r274131  
     12021-03-08  Julian Gonzalez  <julian_a_gonzalez@apple.com>
     2
     3        Crash in in ReplaceSelectionCommand::mergeEndIfNeeded()
     4        https://bugs.webkit.org/show_bug.cgi?id=222941
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Make a copy of Ref<HTMLBRElement> when inserting before start of paragraph.
     9
     10        * editing/ReplaceSelectionCommand.cpp:
     11        (WebCore::ReplaceSelectionCommand::mergeEndIfNeeded):
     12
    1132021-03-08  Jean-Yves Avenard  <jya@apple.com>
    214
  • trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp

    r272143 r274131  
    968968    if (endOfParagraph(startOfParagraphToMove) == destination) {
    969969        auto placeholder = HTMLBRElement::create(document());
    970         auto* placeholderPtr = placeholder.ptr();
    971         insertNodeBefore(WTFMove(placeholder), *startOfParagraphToMove.deepEquivalent().deprecatedNode());
    972         destination = VisiblePosition(positionBeforeNode(placeholderPtr));
     970        insertNodeBefore(placeholder.copyRef(), *startOfParagraphToMove.deepEquivalent().deprecatedNode());
     971        destination = VisiblePosition(positionBeforeNode(placeholder.ptr()));
    973972    }
    974973
Note: See TracChangeset for help on using the changeset viewer.