Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / cursor-position.html
blobcd7c8227aac8b85a2ca71afe99dc4d0a0ea6f24d
1 <html>
2 <head>
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);
10 function test()
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...
21 elt.value = txt;
22 elt.setSelectionRange(10, 14);
23 elt.focus();
24 elt.value = txt2;
25 elt.focus();
26 print(elt.selectionStart.toString() + ", " + elt.selectionEnd.toString());
28 // test setCursorPosition...
29 elt.value = txt2;
30 elt.setSelectionRange(10, 14);
31 elt.focus();
32 elt.value = txt;
33 elt.focus();
34 print(elt.selectionStart.toString() + ", " + elt.selectionEnd.toString());
36 </script>
37 </head>
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>
42 <br />
43 <p>rdar://problem/5423067 gmail is super annoying when trying to add a new name to the TO, CC or BCC fields</p>
44 <hr />
45 <form>
46 <textarea id="text"></textarea>
47 </form>
48 <hr />
49 <p><ol id="console"></ol></p>
50 </body>
51 </html>