Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/editing/inserting/insert_paragraph_separator.html |
| diff --git a/third_party/WebKit/LayoutTests/editing/inserting/insert_paragraph_separator.html b/third_party/WebKit/LayoutTests/editing/inserting/insert_paragraph_separator.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..9cca8e5637edb466b8d598ff22ca22b88c891d31 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/editing/inserting/insert_paragraph_separator.html |
| @@ -0,0 +1,33 @@ |
| +<!doctype html> |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| +<script src="../assert_selection.js"></script> |
| +<div id="log"></div> |
| +<script> |
| +test(() => assert_selection( |
| + '<div contenteditable>foo<br><div>|bar</div></div>', |
| + 'insertParagraph', |
| + '<div contenteditable>foo<br><div><br></div><div>|bar</div></div>'), |
| + 'insert a paragraph separator after BR and before character'); |
| + |
| +test(() => assert_selection( |
| + '<div contenteditable>foo<div>|bar</div></div>', |
| + 'insertParagraph', |
| + '<div contenteditable>foo<div><br></div><div>|bar</div></div>'), |
| + 'insert a paragraph separator before character'); |
| + |
| +// A Testt for a bug in the paragraph separator insertion code that would add an |
|
yoichio
2016/08/30 02:02:01
s/Testt/Test/g
yosin_UTC9
2016/08/30 04:41:09
Done
|
| +// extra newline when inserting a paragraph separator at the end of a paragraph |
| +// in text that preserves newlines. Also, an extraneous space would be added |
| +// after 'foo'. Only one newline should be added. And there should be no |
| +// extraneous spaces. |
| +// |
| +// It demonstrates a bug: too much padding is left between the new line and the |
| +// end of the paragraph containing 'foo'. |
| +test(() => assert_selection( |
| + '<div contenteditable><pre>foo\n|bar</pre></div>', |
| + 'insertParagraph', |
| + '<div contenteditable><pre>foo\n<br></pre><pre>|bar</pre></div>'), |
| + 'insert a paragraph separator in PRE'); |
| +</script> |
| + |