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

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

Issue 2175433002: Remove the unnecessary blockquote after indenting an empty blockquote (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test fail Created 4 years, 5 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/editing/execCommand/indent/indent_empty_quote.html ('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/IndentOutdentCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/IndentOutdentCommand.cpp b/third_party/WebKit/Source/core/editing/commands/IndentOutdentCommand.cpp
index 8c6f691acaa73280127d870e1cbcd3db7327a4f5..a69d57d5fb05317a0c6673dab97414960ecd3781 100644
--- a/third_party/WebKit/Source/core/editing/commands/IndentOutdentCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/IndentOutdentCommand.cpp
@@ -136,9 +136,14 @@ void IndentOutdentCommand::indentIntoBlockquote(const Position& start, const Pos
// Create a new blockquote and insert it as a child of the root editable element. We accomplish
// this by splitting all parents of the current paragraph up to that point.
targetBlockquote = createBlockElement();
- if (outerBlock == start.computeContainerNode())
- insertNodeAt(targetBlockquote, start, editingState);
- else
+ if (outerBlock == start.computeContainerNode()) {
+ // When we apply indent to an empty <blockquote>, we should call insertNodeAfter().
+ // See http://crbug.com/625802 for more details.
+ if (outerBlock->hasTagName(blockquoteTag))
+ insertNodeAfter(targetBlockquote, outerBlock, editingState);
+ else
+ insertNodeAt(targetBlockquote, start, editingState);
+ } else
insertNodeBefore(targetBlockquote, outerBlock, editingState);
if (editingState->isAborted())
return;
« no previous file with comments | « third_party/WebKit/LayoutTests/editing/execCommand/indent/indent_empty_quote.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698