| Index: third_party/WebKit/LayoutTests/editing/inserting/editing-empty-divs.html
|
| diff --git a/third_party/WebKit/LayoutTests/editing/inserting/editing-empty-divs.html b/third_party/WebKit/LayoutTests/editing/inserting/editing-empty-divs.html
|
| index eea2c18fcc16f745fd1ab64973d7271fd1e1d857..55aa59c524661ca36b1d341ab73aafec239394d8 100644
|
| --- a/third_party/WebKit/LayoutTests/editing/inserting/editing-empty-divs.html
|
| +++ b/third_party/WebKit/LayoutTests/editing/inserting/editing-empty-divs.html
|
| @@ -1,56 +1,35 @@
|
| -<html>
|
| -
|
| -<head>
|
| -<script>
|
| -if (window.testRunner)
|
| - testRunner.dumpEditingCallbacks();
|
| -</script>
|
| -
|
| -<script>
|
| -</script>
|
| -</head>
|
| -<style>
|
| -div {
|
| - border: 1px dotted blue;
|
| - min-height: 20px;
|
| - width: 90%;
|
| -}
|
| -</style>
|
| -
|
| +<!doctype html>
|
| +<script src="../../resources/testharness.js"></script>
|
| +<script src="../../resources/testharnessreport.js"></script>
|
| +<script src="../assert_selection.js"></script>
|
| <script>
|
| -function foo() {
|
| - var selection = window.getSelection();
|
| - var bar = 1;
|
| - var divs = document.getElementsByTagName("div");
|
| - for (var i = 0; divs[i]; i++) {
|
| - selection.collapse(divs[i], 0);
|
| - document.execCommand("InsertText", false, 'c');
|
| - }
|
| -}
|
| +test(() => assert_selection(
|
| + '<div contenteditable>|hello</div>',
|
| + 'insertText c',
|
| + '<div contenteditable>c|hello</div>'),
|
| + 'insert text into DIV with some text');
|
| +
|
| +test(() => assert_selection(
|
| + '<div contenteditable>|</div>',
|
| + 'insertText c',
|
| + '<div contenteditable>c|</div>'),
|
| + 'insert text into completely empty DIV');
|
| +
|
| +test(() => assert_selection(
|
| + '<div contenteditable>|\n</div>',
|
| + 'insertText c',
|
| + '<div contenteditable>c|\n</div>'),
|
| + 'insert text into DIV with collapsable whitespace');
|
| +
|
| +test(() => assert_selection(
|
| + '<div contenteditable style="min-height: 20px">|<p></p></div>',
|
| + 'insertText c',
|
| + '<div contenteditable style="min-height: 20px">c|<p></p></div>'),
|
| + 'insert text into DIV with empty P');
|
| +
|
| +test(() => assert_selection(
|
| + '<div contenteditable style="min-height: 20px">|\n<p></p>\n</div>',
|
| + 'insertText c',
|
| + '<div contenteditable style="min-height: 20px">c|\n<p></p>\n</div>'),
|
| + 'insert text into DIV with empty P with collapsable whitespace');
|
| </script>
|
| -<body onload="foo()">
|
| -
|
| -<p>This tests the ability to start editing in blocks that are visible, but have little or no content. Each of the divs below should be able to accept a caret.</p>
|
| -
|
| -<p>This div contains some text.</p>
|
| -<div contentEditable="true">
|
| -hello
|
| -</div>
|
| -
|
| -<p>This div is completely empty.</p>
|
| -<div contentEditable="true"></div>
|
| -
|
| -<p>This div contains some collapsable whitespace (a '\n').</p>
|
| -<div contentEditable="true">
|
| -</div>
|
| -
|
| -<p>This div contains a self-closing p tag.</p>
|
| -<div contentEditable="true"><p /></div>
|
| -
|
| -<p>This div contains a self-closing p tag and some collapsable whitespace (two '\n's before and after the self closing p.</p>
|
| -<div contentEditable="true">
|
| -<p />
|
| -</div>
|
| -
|
| -</body>
|
| -</html>
|
|
|