15 <textarea id=
"textarea" rows=
"6">
33 <p>This tests autoscroll in text area correctly shows selection highlight.
34 To manually test, scroll the text area down to the end.
35 Slowly drag up your mouse starting from the line closest to the upper edge of the text area.
36 Once the contents of the text area get scrolled a little,
37 the selection should not jump down to the end.
</p>
41 if (window
.testRunner
)
42 testRunner
.dumpAsText();
44 // The text area displays 6 lines of text. We scroll down to the end
45 // and start dragging the cursor up from the first line that appears (the k line).
46 // Therefore, the selection should contain the letter k.
47 var textarea
= document
.getElementById("textarea");
48 textarea
.scrollTop
= textarea
.scrollHeight
;
49 if (window
.eventSender
) {
50 var x
= textarea
.offsetLeft
+ textarea
.offsetWidth
/ 2;
51 var y
= textarea
.offsetTop
+ 1;
52 eventSender
.dragMode
= false;
53 eventSender
.mouseMoveTo(x
, y
);
54 eventSender
.mouseDown();
55 eventSender
.mouseMoveTo(x
, 0);
56 eventSender
.mouseUp();
58 var log
= document
.getElementById("log");
59 var selectedText
= window
.getSelection().toString();
60 if (selectedText
.indexOf("k") != -1)
61 log
.innerText
= "PASSED the selection did not jump down.";
63 log
.innerText
= "FAILED the selection jumped down.";