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

Unified Diff: third_party/WebKit/LayoutTests/editing/execCommand/indent/indent_root.html

Issue 2753193002: Editing: Indent command: Do not insert BLOCKQUOTE under the root HTML element. (Closed)
Patch Set: . Created 3 years, 9 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: third_party/WebKit/LayoutTests/editing/execCommand/indent/indent_root.html
diff --git a/third_party/WebKit/LayoutTests/editing/execCommand/indent/indent_root.html b/third_party/WebKit/LayoutTests/editing/execCommand/indent/indent_root.html
new file mode 100644
index 0000000000000000000000000000000000000000..67533544b2fa1a271cc129633e84d4c1f2977920
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/editing/execCommand/indent/indent_root.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<script src="../../assert_selection.js"></script>
+<script>
+test(() => {
+ assert_selection(
+ '',
+ selection => {
+ let doc = selection.document;
+ doc.documentElement.innerHTML = `<style>aaa</style>
+First text in BODY
+<br/>
+<style>
+* { display: -webkit-inline-box; }
+.CLASS11 { float: right;}
+</style>
+<div class="CLASS11"></div>
+Trailing text`;
+
+ doc.designMode = 'on';
+ doc.execCommand("SelectAll")
yosin_UTC9 2017/03/17 10:04:11 nit: Let's use single-quote since other parts use
+ doc.execCommand("Indent");
yosin_UTC9 2017/03/17 10:04:11 nit: Let's use single-quote since other parts use
+ },
+
+ // TODO(tkent): We successfully avoid inserting BLOCKQUOTE under HTML, but
+ // inserting BR in the first STYLE looks wrong and resultant selection is
+ // weird.
+ '<html><head><style>aa<br>^a</style>\n</head>' +
+ '<body><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;">' +
+ 'First text in BODY<br><style>\n* { display: -webkit-inline-box; }\n.CLASS11 { float: right;}\n' +
+ '<br></style>\nTrailing tex|t</blockquote><br><div class="CLASS11"></div>' +
+ '</body></html>',
+ {'dumpFromRoot': true});
+}, 'Indent the whole tree should not insert new nodes under the documentElement.');
+</script>

Powered by Google App Engine
This is Rietveld 408576698