| Index: Source/core/editing/DeleteSelectionCommand.cpp
|
| diff --git a/Source/core/editing/DeleteSelectionCommand.cpp b/Source/core/editing/DeleteSelectionCommand.cpp
|
| index 9ba5478843d829c558f1d7882ba0384f3f6fa488..91813a5a2e75a965fd5b5688506efa6b61c6c1b7 100644
|
| --- a/Source/core/editing/DeleteSelectionCommand.cpp
|
| +++ b/Source/core/editing/DeleteSelectionCommand.cpp
|
| @@ -763,9 +763,12 @@ void DeleteSelectionCommand::doApply()
|
| EAffinity affinity = m_selectionToDelete.affinity();
|
|
|
| Position downstreamEnd = m_selectionToDelete.end().downstream();
|
| - m_needPlaceholder = isStartOfParagraph(m_selectionToDelete.visibleStart(), CanCrossEditingBoundary)
|
| - && isEndOfParagraph(m_selectionToDelete.visibleEnd(), CanCrossEditingBoundary)
|
| - && !lineBreakExistsAtVisiblePosition(m_selectionToDelete.visibleEnd());
|
| + bool rootWillStayOpenWithoutPlaceholder = downstreamEnd.containerNode() == downstreamEnd.containerNode()->rootEditableElement()
|
| + || (downstreamEnd.containerNode()->isTextNode() && downstreamEnd.containerNode()->parentNode() == downstreamEnd.containerNode()->rootEditableElement());
|
| + m_needPlaceholder = !rootWillStayOpenWithoutPlaceholder
|
| + && isStartOfParagraph(m_selectionToDelete.visibleStart(), CanCrossEditingBoundary)
|
| + && isEndOfParagraph(m_selectionToDelete.visibleEnd(), CanCrossEditingBoundary)
|
| + && !lineBreakExistsAtVisiblePosition(m_selectionToDelete.visibleEnd());
|
| if (m_needPlaceholder) {
|
| // Don't need a placeholder when deleting a selection that starts just before a table
|
| // and ends inside it (we do need placeholders to hold open empty cells, but that's
|
|
|