| 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 be7c50135b4d1bf6efab0bfefaf2300d84a36705..f7b9cc74f192f4adea6f404c68e564e143636355 100644
|
| --- a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
|
| @@ -461,8 +461,9 @@ static bool hasMatchingQuoteLevel(VisiblePosition endOfExistingContent,
|
| Position inserted = endOfInsertedContent.deepEquivalent();
|
| bool isInsideMailBlockquote = enclosingNodeOfType(
|
| inserted, isMailHTMLBlockquoteElement, CanCrossEditingBoundary);
|
| - return isInsideMailBlockquote && (numEnclosingMailBlockquotes(existing) ==
|
| - numEnclosingMailBlockquotes(inserted));
|
| + return isInsideMailBlockquote &&
|
| + (numEnclosingMailBlockquotes(existing) ==
|
| + numEnclosingMailBlockquotes(inserted));
|
| }
|
|
|
| bool ReplaceSelectionCommand::shouldMergeStart(
|
| @@ -550,8 +551,9 @@ bool ReplaceSelectionCommand::shouldMerge(const VisiblePosition& source,
|
| Element* destinationBlock = enclosingBlock(destinationNode);
|
| return !enclosingNodeOfType(source.deepEquivalent(),
|
| &isMailPasteAsQuotationHTMLBlockQuoteElement) &&
|
| - sourceBlock && (!sourceBlock->hasTagName(blockquoteTag) ||
|
| - isMailHTMLBlockquoteElement(sourceBlock)) &&
|
| + sourceBlock &&
|
| + (!sourceBlock->hasTagName(blockquoteTag) ||
|
| + isMailHTMLBlockquoteElement(sourceBlock)) &&
|
| enclosingListChild(sourceBlock) ==
|
| enclosingListChild(destinationNode) &&
|
| enclosingTableCell(source.deepEquivalent()) ==
|
| @@ -1964,9 +1966,10 @@ void ReplaceSelectionCommand::mergeTextNodesAroundPosition(
|
|
|
| if (positionOnlyToBeUpdatedIsOffsetInAnchor) {
|
| if (positionOnlyToBeUpdated.computeContainerNode() == text)
|
| - positionOnlyToBeUpdated = Position(
|
| - text, previous->length() +
|
| - positionOnlyToBeUpdated.offsetInContainerNode());
|
| + positionOnlyToBeUpdated =
|
| + Position(text,
|
| + previous->length() +
|
| + positionOnlyToBeUpdated.offsetInContainerNode());
|
| else if (positionOnlyToBeUpdated.computeContainerNode() == previous)
|
| positionOnlyToBeUpdated =
|
| Position(text, positionOnlyToBeUpdated.offsetInContainerNode());
|
| @@ -1991,9 +1994,9 @@ void ReplaceSelectionCommand::mergeTextNodesAroundPosition(
|
|
|
| if (positionOnlyToBeUpdatedIsOffsetInAnchor &&
|
| positionOnlyToBeUpdated.computeContainerNode() == next)
|
| - positionOnlyToBeUpdated =
|
| - Position(text, originalLength +
|
| - positionOnlyToBeUpdated.offsetInContainerNode());
|
| + positionOnlyToBeUpdated = Position(
|
| + text,
|
| + originalLength + positionOnlyToBeUpdated.offsetInContainerNode());
|
| else
|
| updatePositionForNodeRemoval(positionOnlyToBeUpdated, *next);
|
|
|
|
|