| Index: third_party/WebKit/LayoutTests/editing/inserting/return-key-with-selection-001.html
|
| diff --git a/third_party/WebKit/LayoutTests/editing/inserting/return-key-with-selection-001.html b/third_party/WebKit/LayoutTests/editing/inserting/return-key-with-selection-001.html
|
| index 7baa308e8d839c5f5c687109de0c8d8c8e6e4452..a63157211be61d7c152fab585597d9240f49376c 100644
|
| --- a/third_party/WebKit/LayoutTests/editing/inserting/return-key-with-selection-001.html
|
| +++ b/third_party/WebKit/LayoutTests/editing/inserting/return-key-with-selection-001.html
|
| @@ -1,61 +1,37 @@
|
| -<html>
|
| -<head>
|
| -
|
| -<style>
|
| -.editing {
|
| - border: 2px solid red;
|
| - font-size: 24px;
|
| -}
|
| -.explanation {
|
| - border: 2px solid blue;
|
| - padding: 12px;
|
| - font-size: 24px;
|
| - margin-bottom: 24px;
|
| -}
|
| -.scenario { margin-bottom: 16px;}
|
| -.scenario:first-line { font-weight: bold; margin-bottom: 16px;}
|
| -.expected-results:first-line { font-weight: bold }
|
| -</style>
|
| -<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
|
| -
|
| -<script>
|
| -
|
| -function editingTest() {
|
| - moveSelectionForwardByLineCommand();
|
| - extendSelectionForwardByLineCommand();
|
| - insertParagraphCommand();
|
| -}
|
| -
|
| -</script>
|
| -
|
| -<title>Editing Test</title>
|
| -</head>
|
| -<body>
|
| -
|
| +<!DOCTYPE html>
|
| +<script src="../../resources/testharness.js"></script>
|
| +<script src="../../resources/testharnessreport.js"></script>
|
| <div class="explanation">
|
| <div class="scenario">
|
| Tests:
|
| <br>
|
| Fix for this bug:
|
| -<a href="rdar://problem/4045521"><rdar://problem/4045521></a> Hitting return key with full line selected does not add blank line as it should
|
| +Hitting return key with full line selected does not add blank line as it should
|
| </div>
|
| <div class="expected-results">
|
| Expected Results:
|
| <br>
|
| -Should see this content in the red box below (note that the insertion point should be at the start of the third line, immediately preceding "baz"):
|
| +Should see this content in the box below (note that the insertion point should be at the start of the third line, immediately preceding "baz"):
|
| <div>foo</div><div><br></div><div>baz</div>
|
| </div>
|
| </div>
|
|
|
| <div contenteditable id="root" style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space;">
|
| -<div id="test" class="editing">
|
| -<div>foo</div><div>bar</div><div>baz</div>
|
| -</div>
|
| -</div>
|
| -
|
| +<div id="sample" class="editing"><div>foo</div><div>bar</div><div>baz</div></div></div>
|
| +<div id="log"></div>
|
| <script>
|
| -runEditingTest();
|
| +test(function() {
|
| + var selection = window.getSelection();
|
| + var sample = document.getElementById('sample');
|
| +
|
| + selection.collapse(sample, 0);
|
| + selection.modify('move', 'forward', 'line');
|
| + selection.modify('extend', 'forward', 'line');
|
| + document.execCommand('insertParagraph');
|
| +
|
| + assert_equals(sample.innerHTML, '<div>foo</div><div><br></div><div>baz<br></div>');
|
| + assert_true(selection.isCollapsed);
|
| + assert_equals(selection.anchorNode, sample.childNodes[2].firstChild);
|
| + assert_equals(selection.anchorOffset, 0);
|
| +});
|
| </script>
|
| -
|
| -</body>
|
| -</html>
|
|
|