| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../../resources/js-test.js"></script> | 3 <script src="../../../resources/js-test.js"></script> |
| 4 </head> | 4 </head> |
| 5 <body> | 5 <body> |
| 6 <p>This tests for problems where we'd lose the selection in a textarea when maki
ng style and value changes.</p> | 6 <p>This tests for problems where we'd lose the selection in a textarea when maki
ng style and value changes.</p> |
| 7 <div id="console"></div> | 7 <div id="console"></div> |
| 8 <form id="form"><textarea id="ta">abc123 | 8 <form id="form"><textarea id="ta">abc123 |
| 9 </textarea></form> | 9 </textarea></form> |
| 10 <script type="text/javascript"> | 10 <script type="text/javascript"> |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 shouldBe('ta.selectionEnd', '9'); | 61 shouldBe('ta.selectionEnd', '9'); |
| 62 | 62 |
| 63 debug("- append a text node"); | 63 debug("- append a text node"); |
| 64 ta.appendChild(document.createTextNode('foo')); | 64 ta.appendChild(document.createTextNode('foo')); |
| 65 shouldBe('ta.selectionStart', '12'); | 65 shouldBe('ta.selectionStart', '12'); |
| 66 shouldBe('ta.selectionEnd', '12'); | 66 shouldBe('ta.selectionEnd', '12'); |
| 67 | 67 |
| 68 debug("- append a empty text node"); | 68 debug("- append a empty text node"); |
| 69 ta.setSelectionRange(2, 3); | 69 ta.setSelectionRange(2, 3); |
| 70 ta.appendChild(document.createTextNode('')); | 70 ta.appendChild(document.createTextNode('')); |
| 71 shouldBe('ta.selectionStart', '12'); | 71 shouldBe('ta.selectionStart', '2'); |
| 72 shouldBe('ta.selectionEnd', '12'); | 72 shouldBe('ta.selectionEnd', '3'); |
| 73 </script> | 73 </script> |
| 74 </body> | 74 </body> |
| 75 </html> | 75 </html> |
| OLD | NEW |