| <script type="text/javascript"> |
| var paragraph = document.createElement("li"); |
| paragraph.appendChild(document.createTextNode(message)); |
| document.getElementById("console").appendChild(paragraph); |
| var elt = document.getElementById("text"); |
| txt = "this is\ra test\rof cursor"; |
| txt2 = "this is\na test\nof cursor!"; |
| // test getCursorPosition... |
| elt.setSelectionRange(10, 14); |
| print(elt.selectionStart.toString() + ", " + elt.selectionEnd.toString()); |
| // test setCursorPosition... |
| elt.setSelectionRange(10, 14); |
| print(elt.selectionStart.toString() + ", " + elt.selectionEnd.toString()); |
| <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> |
| <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> |
| <p>Because this would invalidate the previous test, and that the previous test now perfectly shows the new behavior, we repurposed it.</p> |
| <p>rdar://problem/5423067 gmail is super annoying when trying to add a new name to the TO, CC or BCC fields</p> |
| <textarea id="text"></textarea> |
| <p><ol id="console"></ol></p> |