1layer at (0,0) size 800x600
2 LayoutView at (0,0) size 800x600
3layer at (0,0) size 800x215
4 LayoutBlockFlow {HTML} at (0,0) size 800x215
5 LayoutBlockFlow {BODY} at (8,16) size 784x191
6 LayoutBlockFlow {P} at (0,0) size 784x20
7 LayoutText {#text} at (0,0) size 588x19
8 text run at (0,0) width 588: "Test passes if, when the text area below is focused for editing, the text insertion caret is green."
9 LayoutBlockFlow {P} at (0,36) size 784x20
10 LayoutText {#text} at (0,0) size 432x19
11 text run at (0,0) width 432: "The shape of the caret, and whether it flashes, are not part of the test."
12 LayoutBlockFlow (anonymous) at (0,72) size 784x119
13 LayoutText {#text} at (0,0) size 0x0
14layer at (8,88) size 412x114 clip at (9,89) size 410x112
15 LayoutTextControl {TEXTAREA} at (0,0) size 412x114 [color=#FFFFFF] [bgcolor=#000000] [border: (1px solid #A9A9A9)]
16 LayoutBlockFlow {DIV} at (11,11) size 390x46
17caret: position 0 of child 0 {DIV} of {#document-fragment} of child 5 {TEXTAREA} of body
1Tests various scenarios for caret position when direction is auto
2
3On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6PASS textarea.value is "א!"
71. Caret is at right if text is in LTR direction
8PASS textarea.value is "א!\nhello"
9Compares lines if they are different
10PASS beforeCaretPos[1] is not afterCaretPos[1]
11New text is in LTR direction, start of caret will differ
12PASS beforeCaretPos[0] is > afterCaretPos[0]
132. Addition of RTL text in middle of LTR text, caret moves to the left of the line.
14PASS textarea.value is "א!\nhelloאא"
15RTL text added will be move caret to start of position where hello begins
16PASS beforeCaretPos[0] is afterCaretPos[0]+afterCaretPos[2]
173. Adding LTR text after RTL should move caret towards right.
18PASS textarea.value is "א!\nhelloאאbye"
19Start position of caret is same
20PASS beforeCaretPos[0]+beforeCaretPos[2] is afterCaretPos[0]
21But end position differs
22PASS beforeCaretPos[0]+beforeCaretPos[2] is not afterCaretPos[0]+afterCaretPos[2]
234. Adding space, caret should move caret
24PASS textarea.value is "א!\nhelloאאbye "
25PASS afterCaretPos[0]+afterCaretPos[2] is > beforeCaretPos[0]+beforeCaretPos[2]
26PASS successfullyParsed is true
27
28TEST COMPLETE
29