3 <script type=
"text/javascript">
4 function print(message
)
6 var paragraph
= document
.createElement("li");
7 paragraph
.appendChild(document
.createTextNode(message
));
8 document
.getElementById("console").appendChild(paragraph
);
12 if (window
.testRunner
) {
13 testRunner
.dumpAsText();
16 var elt
= document
.getElementById("text");
17 txt
= "this is\ra test\rof cursor";
18 txt2
= "this is\na test\nof cursor!";
20 // test getCursorPosition...
22 elt
.setSelectionRange(10, 14);
26 print(elt
.selectionStart
.toString() + ", " + elt
.selectionEnd
.toString());
28 // test setCursorPosition...
30 elt
.setSelectionRange(10, 14);
34 print(elt
.selectionStart
.toString() + ", " + elt
.selectionEnd
.toString());
38 <body onload=
"test();">
39 <p>This test used to check that the selection start was the same before and after a change to the contents of a textarea.
</p>
40 <p>However now, in order to match the behavior of the other major browsers, selection is moved to the end of the text value when a change occurs to the contents of a text area.
</p>
41 <p>Because this would invalidate the previous test, and that the previous test now perfectly shows the new behavior, we repurposed it.
</p>
43 <p>rdar://problem/
5423067 gmail is super annoying when trying to add a new name to the TO, CC or BCC fields
</p>
46 <textarea id=
"text"></textarea>
49 <p><ol id=
"console"></ol></p>