Changeset 27796 in webkit
- Timestamp:
- Nov 14, 2007 2:33:07 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r27795 r27796 1 2007-11-14 Justin Garcia <justin.garcia@apple.com> 2 3 Reviewed by Alexey Proskuryakov. 4 5 <rdar://problem/5546763> CrashTracer: [USER] 362 crashes at WebCore::DeleteSelectionCommand::mergeParagraphs 6 7 * editing/deleting/5546763-expected.txt: Added. 8 * editing/deleting/5546763.html: Added. 9 1 10 2007-11-14 Anders Carlsson <andersca@apple.com> 2 11 -
trunk/WebCore/ChangeLog
r27789 r27796 1 2007-11-14 Justin Garcia <justin.garcia@apple.com> 2 3 Reviewed by Alexey Proskuryakov. 4 5 <rdar://problem/5546763> CrashTracer: [USER] 362 crashes at WebCore::DeleteSelectionCommand::mergeParagraphs 6 7 * editing/DeleteSelectionCommand.cpp: 8 (WebCore::DeleteSelectionCommand::handleGeneralDelete): 9 Removed an irrelevant FIXME. 10 (WebCore::DeleteSelectionCommand::mergeParagraphs): If the block that contained the end of the selection 11 hasn't been removed but has been emptied by deletion, we would to try and fail to create a VisiblePosition 12 inside that block, which could lead to a crash. If that happens, there's no content in the block to move, 13 so just remove the block and return. 14 Preserve m_needPlaceholder during the call to moveParagraphs, since it may change it and since it does 15 its own placeholder insertion when necessary. 16 (WebCore::DeleteSelectionCommand::doApply): No need to check m_needPlaceholder before calling mergeParagraphs, 17 because it handles preserving m_needPlaceholder when it calls moveParagraphs. 18 1 19 2007-11-14 Timothy Hatcher <timothy@apple.com> 2 20 -
trunk/WebCore/editing/DeleteSelectionCommand.cpp
r27690 r27796 447 447 if (m_downstreamEnd.node() != startNode && !m_upstreamStart.node()->isDescendantOf(m_downstreamEnd.node()) && m_downstreamEnd.node()->inDocument() && m_downstreamEnd.offset() >= caretMinOffset(m_downstreamEnd.node())) { 448 448 if (m_downstreamEnd.offset() >= maxDeepOffset(m_downstreamEnd.node()) && !canHaveChildrenForEditing(m_downstreamEnd.node())) { 449 // FIXME: Shouldn't remove m_downstreamEnd.node() if its offsets refer to children.450 449 // The node itself is fully selected, not just its contents. Delete it. 451 450 removeNode(m_downstreamEnd.node()); … … 520 519 VisiblePosition mergeDestination(m_upstreamStart); 521 520 521 // m_downstreamEnd's block has been emptied out by deletion. There is no content inside of it to 522 // move, so just remove it. 523 Element* endBlock = static_cast<Element*>(enclosingBlock(m_downstreamEnd.node())); 524 if (!startOfParagraphToMove.deepEquivalent().node() || !endBlock->contains(startOfParagraphToMove.deepEquivalent().node())) { 525 removeNode(enclosingBlock(m_downstreamEnd.node())); 526 return; 527 } 528 522 529 // We need to merge into m_upstreamStart's block, but it's been emptied out and collapsed by deletion. 523 530 if (!mergeDestination.deepEquivalent().node() || !mergeDestination.deepEquivalent().node()->isDescendantOf(m_upstreamStart.node()->enclosingBlockFlowElement())) { … … 551 558 return; 552 559 560 // moveParagraphs will insert placeholders if it removes blocks that would require their use, don't let block 561 // removals that it does cause the insertion of *another* placeholder. 562 bool needPlaceholder = m_needPlaceholder; 553 563 moveParagraph(startOfParagraphToMove, endOfParagraphToMove, mergeDestination); 564 m_needPlaceholder = needPlaceholder; 554 565 // The endingPosition was likely clobbered by the move, so recompute it (moveParagraph selects the moved paragraph). 555 566 m_endingPosition = endingSelection().start(); … … 719 730 720 731 fixupWhitespace(); 721 722 RefPtr<Node> placeholder = m_needPlaceholder ? createBreakElement(document()) : 0;723 732 724 733 mergeParagraphs(); 725 734 726 735 removePreviouslySelectedEmptyTableRows(); 736 737 RefPtr<Node> placeholder = m_needPlaceholder ? createBreakElement(document()).get() : 0; 727 738 728 739 if (placeholder)
Note: See TracChangeset
for help on using the changeset viewer.