LayoutTests/ChangeLog

 12013-08-12 Arpita Bahuguna <a.bah@samsung.com>
 2
 3 Adding testcase for verifying editing behavior for up/down caret movement between lines.
 4 https://bugs.webkit.org/show_bug.cgi?id=119511
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * editing/selection/verify-editing-behavior-for-line-granularity-expected.txt: Added.
 9 * editing/selection/verify-editing-behavior-for-line-granularity.html: Added.
 10 Layout testcase added for verifying that the up/down caret movement between
 11 lines is similar to the default text editor behavior on various platforms.
 12
1132013-08-12 Zoltan Arvai <zarvai@inf.u-szeged.hu>
214
315 [Qt] Unreviewed gardening. Rebaselining after r153903.
153938

LayoutTests/editing/selection/verify-editing-behavior-for-line-granularity-expected.txt

 1When moving the caret up/down between lines, our editing behavior is similar to that of the text editors on various platforms such as mac, windows and linux. When no further up/down movement is possible, the caret is moved either to the start (for up) or end (for down) of the line. This should not reset the "x" co-ordinate maintained for the start caret position and moving the caret down from the start of a line (or vice-versa) should bring it to a position which is offset by this "x" amount on the adjacent line.
 2
 3Testcase for bug 119511: Adding testcase for verifying editing behavior for up/down caret movement between lines. To manually verify the issue, place the caret somewhere in between the first line and then press the up arrow key. This should move the caret to the start of the first line. Next press the down arrow key. This should result in the caret being placed on the next line offset by an amount equivalent to the start "x" position of the caret on the previous line. Similarly, forward caret movement too can be verified.
 4
 5On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 6
 7PASS caretRectAfterDownArrowKey.left is startCaretRectOnSecondLine.left
 8PASS caretRectAfterDownArrowKey.top is startCaretRectOnSecondLine.top
 9PASS caretRectAfterUpArrowKey.left is startCaretRectOnFirstLine.left
 10PASS caretRectAfterUpArrowKey.top is startCaretRectOnFirstLine.top
 11
0

LayoutTests/editing/selection/verify-editing-behavior-for-line-granularity.html

 1<!DOCTYPE html>
 2<html>
 3<head>
 4<script src="../../fast/js/resources/js-test-pre.js"></script>
 5<script>
 6function runTest() {
 7 description('Testcase for bug <a href="http://bugs.webkit.org/show_bug.cgi?id=119511">119511</a>: Adding testcase for verifying editing behavior for up/down caret movement between lines.\nTo manually verify the issue, place the caret somewhere in between the first line and then press the up arrow key. This should move the caret to the start of the first line. Next press the down arrow key. This should result in the caret being placed on the next line offset by an amount equivalent to the start "x" position of the caret on the previous line.\nSimilarly, forward caret movement too can be verified.');
 8
 9 if (window.internals) {
 10 var selection = window.getSelection();
 11
 12 selection.collapse(document.getElementById('second'), 1);
 13 selection.modify("move", "backward", "word");
 14 startCaretRectOnSecondLine = internals.absoluteCaretBounds(document);
 15
 16 eventSender.keyDown("upArrow");
 17 eventSender.keyDown("upArrow");
 18 eventSender.keyDown("downArrow");
 19 caretRectAfterDownArrowKey = internals.absoluteCaretBounds(document);
 20
 21 shouldBe("caretRectAfterDownArrowKey.left", "startCaretRectOnSecondLine.left");
 22 shouldBe("caretRectAfterDownArrowKey.top", "startCaretRectOnSecondLine.top");
 23
 24 selection.collapse(document.getElementById('first'), 1);
 25 for (i = 0; i < 3; i++)
 26 selection.modify("move", "backward", "word");
 27 startCaretRectOnFirstLine = internals.absoluteCaretBounds(document);
 28
 29 eventSender.keyDown("downArrow");
 30 eventSender.keyDown("downArrow");
 31 eventSender.keyDown("upArrow");
 32 caretRectAfterUpArrowKey = internals.absoluteCaretBounds(document);
 33
 34 shouldBe("caretRectAfterUpArrowKey.left", "startCaretRectOnFirstLine.left");
 35 shouldBe("caretRectAfterUpArrowKey.top", "startCaretRectOnFirstLine.top");
 36
 37 document.getElementById('testDiv').style.display = 'none';
 38 }
 39}
 40</script>
 41</head>
 42<body onload="runTest();">
 43<div>When moving the caret up/down between lines, our editing behavior is similar to that of the text editors on various platforms such as mac, windows and linux. When no further up/down movement is possible, the caret is moved either to the start (for up) or end (for down) of the line. This should not reset the "x" co-ordinate maintained for the start caret position and moving the caret down from the start of a line (or vice-versa) should bring it to a position which is offset by this "x" amount on the adjacent line.</div><br>
 44<div contenteditable=true id="testDiv">
 45<p id="first">First text line for verifying editing behavior. Slightly longer.</p>
 46<p id="second">Second text line for verifying editing behavior.</p>
 47</div>
 48<div id="description"></div>
 49<div id="console"></div>
 50</body>
 51</html>
0