Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(239)

Unified Diff: third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp

Issue 2322853004: Convert an assertion to if-condition in ReplaceSelectionCommand::doApply() (Closed)
Patch Set: 2016-09-12T14:19:36 Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/win/editing/pasteboard/paste-text-009-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/win/editing/pasteboard/paste-text-009-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698