Changeset 282503 in webkit
- Timestamp:
- Sep 16, 2021, 1:14:44 AM (5 years ago)
- Location:
- releases/WebKitGTK/webkit-2.32/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
editing/ReplaceSelectionCommand.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
releases/WebKitGTK/webkit-2.32/Source/WebCore/ChangeLog
r282502 r282503 1 2021-04-14 Julian Gonzalez <julian_a_gonzalez@apple.com> 2 3 Crash in ReplaceSelectionCommand::removeUnrenderedTextNodesAtEnds() 4 https://bugs.webkit.org/show_bug.cgi?id=224520 5 6 Reviewed by Ryosuke Niwa. 7 8 Adopt RefPtr<Node> instead of using plain Node* here to avoid a crash. 9 10 * editing/ReplaceSelectionCommand.cpp: 11 (WebCore::ReplaceSelectionCommand::removeUnrenderedTextNodesAtEnds): 12 1 13 2021-04-14 Carlos Garcia Campos <cgarcia@igalia.com> 2 14 -
releases/WebKitGTK/webkit-2.32/Source/WebCore/editing/ReplaceSelectionCommand.cpp
r280896 r282503 829 829 document().updateLayoutIgnorePendingStylesheets(); 830 830 831 Node* lastLeafInserted = insertedNodes.lastLeafInserted();831 auto lastLeafInserted = makeRefPtr(insertedNodes.lastLeafInserted()); 832 832 if (is<Text>(lastLeafInserted) && !hasRenderedText(downcast<Text>(*lastLeafInserted)) 833 && !enclosingElementWithTag(firstPositionInOrBeforeNode(lastLeafInserted ), selectTag)834 && !enclosingElementWithTag(firstPositionInOrBeforeNode(lastLeafInserted ), scriptTag)) {835 insertedNodes.willRemoveNode(lastLeafInserted );833 && !enclosingElementWithTag(firstPositionInOrBeforeNode(lastLeafInserted.get()), selectTag) 834 && !enclosingElementWithTag(firstPositionInOrBeforeNode(lastLeafInserted.get()), scriptTag)) { 835 insertedNodes.willRemoveNode(lastLeafInserted.get()); 836 836 removeNode(*lastLeafInserted); 837 837 } … … 841 841 // We don't have to make sure that firstNodeInserted isn't inside a select or script element 842 842 // because it is a top level node in the fragment and the user can't insert into those elements. 843 Node* firstNodeInserted = insertedNodes.firstNodeInserted();843 auto firstNodeInserted = makeRefPtr(insertedNodes.firstNodeInserted()); 844 844 if (is<Text>(firstNodeInserted) && !hasRenderedText(downcast<Text>(*firstNodeInserted))) { 845 insertedNodes.willRemoveNode(firstNodeInserted );845 insertedNodes.willRemoveNode(firstNodeInserted.get()); 846 846 removeNode(*firstNodeInserted); 847 847 }
Note:
See TracChangeset
for help on using the changeset viewer.