Chromium Code Reviews| Index: third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp |
| diff --git a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp |
| index f9653a7845a1299a0d7a13cd90d446a0c7df769c..ee40c770e2e403720339361e6239e1625d360a9a 100644 |
| --- a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp |
| +++ b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp |
| @@ -1145,10 +1145,10 @@ void ReplaceSelectionCommand::doApply(EditingState* editingState) |
| Element* enclosingBlockOfInsertionPos = enclosingBlock(insertionPos.anchorNode()); |
| - // Adjust insertionPos to prevent nesting. |
| - // If the start was in a Mail blockquote, we will have already handled adjusting insertionPos above. |
| - if (m_preventNesting && enclosingBlockOfInsertionPos && !isTableCell(enclosingBlockOfInsertionPos) && !startIsInsideMailBlockquote) { |
| - DCHECK_NE(enclosingBlockOfInsertionPos, currentRoot); |
| + // Adjust |enclosingBlockOfInsertionPos| to prevent nesting. |
|
Xiaocheng
2016/09/12 07:19:49
nit: The body of this |if| is still adjusting |ins
yosin_UTC9
2016/09/12 07:36:01
I just change variable name |insertPos| to |enclos
|
| + // If the start was in a Mail blockquote, we will have already handled |
| + // adjusting |enclosingBlockOfInsertionPos| above. |
| + if (m_preventNesting && enclosingBlockOfInsertionPos && enclosingBlockOfInsertionPos != currentRoot && !isTableCell(enclosingBlockOfInsertionPos) && !startIsInsideMailBlockquote) { |
| VisiblePosition visibleInsertionPos = createVisiblePosition(insertionPos); |
| if (isEndOfBlock(visibleInsertionPos) && !(isStartOfBlock(visibleInsertionPos) && fragment.hasInterchangeNewlineAtEnd())) |
| insertionPos = Position::inParentAfterNode(*enclosingBlockOfInsertionPos); |