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

Unified Diff: Source/WebCore/editing/CompositeEditCommand.cpp

Issue 13954003: Remove mail blockquote special case handling. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 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
Index: Source/WebCore/editing/CompositeEditCommand.cpp
diff --git a/Source/WebCore/editing/CompositeEditCommand.cpp b/Source/WebCore/editing/CompositeEditCommand.cpp
index 601bb1ab8b00b5223523c31af9ad4cc293fd9cdb..799d3fc30cd4e8156406051b4604cb973115627b 100644
--- a/Source/WebCore/editing/CompositeEditCommand.cpp
+++ b/Source/WebCore/editing/CompositeEditCommand.cpp
@@ -288,9 +288,9 @@ void CompositeEditCommand::removeStyledElement(PassRefPtr<Element> element)
applyCommandToComposite(ApplyStyleCommand::create(element, true));
}
-void CompositeEditCommand::insertParagraphSeparator(bool useDefaultParagraphElement, bool pasteBlockqutoeIntoUnquotedArea)
+void CompositeEditCommand::insertParagraphSeparator(bool useDefaultParagraphElement)
{
- applyCommandToComposite(InsertParagraphSeparatorCommand::create(document(), useDefaultParagraphElement, pasteBlockqutoeIntoUnquotedArea));
+ applyCommandToComposite(InsertParagraphSeparatorCommand::create(document(), useDefaultParagraphElement));
}
void CompositeEditCommand::insertLineBreak()
@@ -1321,60 +1321,6 @@ bool CompositeEditCommand::breakOutOfEmptyListItem()
return true;
}
-// If the caret is in an empty quoted paragraph, and either there is nothing before that
-// paragraph, or what is before is unquoted, and the user presses delete, unquote that paragraph.
-bool CompositeEditCommand::breakOutOfEmptyMailBlockquotedParagraph()
-{
- if (!endingSelection().isCaret())
- return false;
-
- VisiblePosition caret(endingSelection().visibleStart());
- Node* highestBlockquote = highestEnclosingNodeOfType(caret.deepEquivalent(), &isMailBlockquote);
- if (!highestBlockquote)
- return false;
-
- if (!isStartOfParagraph(caret) || !isEndOfParagraph(caret))
- return false;
-
- VisiblePosition previous(caret.previous(CannotCrossEditingBoundary));
- // Only move forward if there's nothing before the caret, or if there's unquoted content before it.
- if (enclosingNodeOfType(previous.deepEquivalent(), &isMailBlockquote))
- return false;
-
- RefPtr<Node> br = createBreakElement(document());
- // We want to replace this quoted paragraph with an unquoted one, so insert a br
- // to hold the caret before the highest blockquote.
- insertNodeBefore(br, highestBlockquote);
- VisiblePosition atBR(positionBeforeNode(br.get()));
- // If the br we inserted collapsed, for example foo<br><blockquote>...</blockquote>, insert
- // a second one.
- if (!isStartOfParagraph(atBR))
- insertNodeBefore(createBreakElement(document()), br);
- setEndingSelection(VisibleSelection(atBR, endingSelection().isDirectional()));
-
- // If this is an empty paragraph there must be a line break here.
- if (!lineBreakExistsAtVisiblePosition(caret))
- return false;
-
- Position caretPos(caret.deepEquivalent().downstream());
- // A line break is either a br or a preserved newline.
- ASSERT(caretPos.deprecatedNode()->hasTagName(brTag) || (caretPos.deprecatedNode()->isTextNode() && caretPos.deprecatedNode()->renderer()->style()->preserveNewline()));
-
- if (caretPos.deprecatedNode()->hasTagName(brTag))
- removeNodeAndPruneAncestors(caretPos.deprecatedNode());
- else if (caretPos.deprecatedNode()->isTextNode()) {
- ASSERT(caretPos.deprecatedEditingOffset() == 0);
- Text* textNode = toText(caretPos.deprecatedNode());
- ContainerNode* parentNode = textNode->parentNode();
- // The preserved newline must be the first thing in the node, since otherwise the previous
- // paragraph would be quoted, and we verified that it wasn't above.
- deleteTextFromNode(textNode, 0, 1);
- prune(parentNode);
- }
-
- return true;
-}
-
// Operations use this function to avoid inserting content into an anchor when at the start or the end of
// that anchor, as in NSTextView.
// FIXME: This is only an approximation of NSTextViews insertion behavior, which varies depending on how

Powered by Google App Engine
This is Rietveld 408576698