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

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

Issue 2850773003: Use RelocatablePosition in CompositeEditCommand::MoveParagraphWithClones (Closed)
Patch Set: Remove yosin's TODO Created 3 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommandTest.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommandTest.cpp b/third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommandTest.cpp
index 188a6f196b28ac56a7defcf9ed8c4bff5da4c22e..9f970adca5d8c731464e280e56557299af157397 100644
--- a/third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommandTest.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommandTest.cpp
@@ -78,4 +78,35 @@ TEST_F(ApplyBlockElementCommandTest, visibilityChangeDuringCommand) {
GetDocument().documentElement()->innerHTML());
}
+// This is a regression test for https://crbug.com/712510
+TEST_F(ApplyBlockElementCommandTest, IndentHeadingIntoBlockquote) {
+ SetBodyContent(
+ "<div contenteditable=\"true\">"
+ "<h6><button><table></table></button></h6>"
+ "<object></object>"
+ "</div>");
+ Element* button = GetDocument().QuerySelector("button");
+ Element* object = GetDocument().QuerySelector("object");
+ Selection().SetSelection(SelectionInDOMTree::Builder()
+ .Collapse(Position(button, 0))
+ .Extend(Position(object, 0))
+ .Build());
+
+ IndentOutdentCommand* command = IndentOutdentCommand::Create(
+ GetDocument(), IndentOutdentCommand::kIndent);
+ command->Apply();
+
+ // This only records the current behavior, which can be wrong.
+ EXPECT_EQ(
+ "<div contenteditable=\"true\">"
+ "<blockquote style=\"margin: 0 0 0 40px; border: none; padding: 0px;\">"
+ "<h6><button></button></h6>"
+ "<h6><button><table></table></button></h6>"
+ "</blockquote>"
+ "<h6><button></button></h6><br>"
+ "<object></object>"
+ "</div>",
+ GetDocument().body()->innerHTML());
+}
+
} // namespace blink
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698