Changeset 286531 in webkit
- Timestamp:
- Dec 4, 2021, 7:24:46 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/editing/execCommand/outdent-cut-crash-expected.txt (added)
-
LayoutTests/editing/execCommand/outdent-cut-crash.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/editing/CompositeEditCommand.cpp (modified) (2 diffs)
-
Source/WebCore/editing/IndentOutdentCommand.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r286530 r286531 1 2021-12-04 Rob Buis <rbuis@igalia.com> 2 3 Fix parentNode in CompositeEditCommand::splitTreeToNode 4 https://bugs.webkit.org/show_bug.cgi?id=230710 5 6 Reviewed by Ryosuke Niwa. 7 8 * editing/execCommand/outdent-cut-crash-expected.txt: Added. 9 * editing/execCommand/outdent-cut-crash.html: Added. 10 1 11 2021-12-04 Tyler Wilcock <tyler_w@apple.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r286529 r286531 1 2021-12-04 Rob Buis <rbuis@igalia.com> 2 3 Fix parentNode in CompositeEditCommand::splitTreeToNode 4 https://bugs.webkit.org/show_bug.cgi?id=230710 5 6 Reviewed by Ryosuke Niwa. 7 8 Fix parentNode handling in CompositeEditCommand::splitTreeToNode and 9 also a few more IndentOutdentCommand methods to support the test case. 10 11 Test: editing/execCommand/outdent-cut-crash.html 12 13 * editing/CompositeEditCommand.cpp: 14 (WebCore::CompositeEditCommand::moveParagraphs): 15 * editing/IndentOutdentCommand.cpp: 16 (WebCore::IndentOutdentCommand::indentIntoBlockquote): do not call positionInParentAfterNode 17 if insertNodeBefore failed. 18 (WebCore::IndentOutdentCommand::outdentParagraph): need to check for null positions 19 before calling moveParagraphs. 20 1 21 2021-12-04 Alan Bujtas <zalan@apple.com> 2 22 -
trunk/Source/WebCore/editing/CompositeEditCommand.cpp
r284792 r286531 1751 1751 ASSERT(adjustedEnd); 1752 1752 RefPtr<Node> node; 1753 for (node = &start; node && node->parentNode() != adjustedEnd; node = node->parentNode()) {1753 for (node = &start; node && node->parentNode() != adjustedEnd;) { 1754 1754 RefPtr parentNode = node->parentNode(); 1755 1755 if (!parentNode || !is<Element>(*parentNode) || editingIgnoresContent(*parentNode)) … … 1760 1760 if (positionInParent != positionInNode) 1761 1761 splitElement(downcast<Element>(*parentNode), *node); 1762 node = parentNode; 1762 1763 } 1763 1764 -
trunk/Source/WebCore/editing/IndentOutdentCommand.cpp
r280323 r286531 117 117 if (outerBlock == nodeToSplitTo) 118 118 insertNodeAt(*targetBlockquote, start); 119 else 120 insertNodeBefore(*targetBlockquote, *outerBlock);119 else if (!insertNodeBefore(*targetBlockquote, *outerBlock)) 120 return; 121 121 startOfContents = positionInParentAfterNode(targetBlockquote.get()); 122 122 } … … 193 193 auto placeholder = HTMLBRElement::create(document()); 194 194 insertNodeBefore(placeholder, *splitBlockquoteNode); 195 if (placeholder->isConnected()) 196 moveParagraph(startOfParagraph(visibleStartOfParagraph), endOfParagraph(visibleEndOfParagraph), positionBeforeNode(placeholder.ptr()), true); 195 if (!placeholder->isConnected()) 196 return; 197 auto visibleStartOfParagraphToMove = startOfParagraph(visibleStartOfParagraph); 198 auto visibleEndOfParagraphToMove = endOfParagraph(visibleEndOfParagraph); 199 if (visibleStartOfParagraphToMove.isNull() || visibleEndOfParagraphToMove.isNull()) 200 return; 201 moveParagraph(visibleStartOfParagraphToMove, visibleEndOfParagraphToMove, positionBeforeNode(placeholder.ptr()), true); 197 202 } 198 203
Note:
See TracChangeset
for help on using the changeset viewer.