3 <body style=
"white-space: nowrap; margin:100px; border: solid 1px black;" contenteditable
>
4 <span id=
"firstLine">Click on the right of this line outside the black box.
</span><br>
5 <span id=
"longLine">The caret should be placed on the right of the first line, NOT on the right of this line.
9 var longLine
= document
.getElementById('longLine');
10 while (longLine
.offsetWidth
< document
.body
.offsetWidth
+ 200)
11 longLine
.lastChild
.textContent
+= ' some text';
13 if (window
.testRunner
) {
14 testRunner
.dumpAsText();
16 var firstLine
= document
.getElementById('firstLine');
17 eventSender
.mouseMoveTo(firstLine
.offsetLeft
+ document
.body
.offsetWidth
+ 10,
18 firstLine
.offsetTop
+ firstLine
.offsetHeight
/ 2);
19 eventSender
.mouseDown();
20 eventSender
.mouseUp();
22 if (!getSelection().isCollapsed
)
23 document
.writeln('FAIL - selection was not collapsed');
24 else if (getSelection().baseNode
!= firstLine
.firstChild
)
25 document
.writeln('FAIL - caret was not in the first line');
26 else if (getSelection().baseOffset
!= firstLine
.textContent
.length
)
27 document
.writeln('FAIL - caret was not on the right edge');
29 document
.writeln('PASS');
31 longLine
.lastChild
.style
.display
= 'none';