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"> |
11 var ta = document.getElementById('ta'); | 11 var ta = document.getElementById('ta'); |
12 debug("- default value"); | 12 debug("- default value"); |
13 shouldBe('ta.selectionStart', '0'); | 13 shouldBe('ta.selectionStart', '0'); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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', '12'); |
72 shouldBe('ta.selectionEnd', '12'); | 72 shouldBe('ta.selectionEnd', '12'); |
73 </script> | 73 </script> |
74 </body> | 74 </body> |
75 </html> | 75 </html> |
OLD | NEW |