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

Side by Side Diff: LayoutTests/editing/selection/resources/block-cursor-utils.js

Issue 14859008: Use a block cursor in overtype mode (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 6 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 unified diff | Download patch
OLDNEW
(Empty)
1 var blockCursorStartPosition;
2 var blockCursor;
3 var textNode;
4
5 function verifyBlockCursorLeftPositionAndWidth(elementId, expected)
6 {
7 blockCursorStartPosition = new Array();
8
9 var element = document.getElementById(elementId);
10 textNode = element.firstChild;
11 debug("Verifying block cursor position and width for each position in '" + t extNode.nodeValue + "' in a " + element.style.direction + " block");
12
13 for (var i = 0; i < textNode.length; i++) {
14 evalAndLog("getSelection().collapse(textNode, "+i+")");
15
16 blockCursor = internals.selectionBounds();
17 blockCursorStartPosition.push(blockCursor.left);
18
19 if (i > 0 && i < textNode.length) {
20 if (expected[i-1] == ">")
21 shouldBeTrue("blockCursorStartPosition["+(i-1)+"] > blockCursorS tartPosition["+i+"]");
22 else
23 shouldBeTrue("blockCursorStartPosition["+(i-1)+"] < blockCursorS tartPosition["+i+"]");
24 }
25
26 shouldBeTrue("getSelection().isCollapsed");
27 shouldBeTrue("blockCursor.width > 1");
28 shouldBe("internals.absoluteCaretBounds().width", "1");
29 }
30
31 evalAndLog("getSelection().collapse(textNode, "+i+")");
32 blockCursor = internals.selectionBounds();
33 shouldBeZero("blockCursor.width");
34 shouldBe("internals.absoluteCaretBounds().width", "1");
35 debug("");
36 }
OLDNEW
« no previous file with comments | « LayoutTests/editing/selection/block-cursor-overtype-mode-rtl-expected.txt ('k') | Source/core/editing/Editor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698