| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script type="text/javascript"> | 3 <script type="text/javascript"> |
| 4 function print(message) | 4 function print(message) |
| 5 { | 5 { |
| 6 var paragraph = document.createElement("div"); | 6 var paragraph = document.createElement("div"); |
| 7 if (message == "") { | 7 if (message == "") { |
| 8 paragraph.appendChild(document.createElement("br")); | 8 paragraph.appendChild(document.createElement("br")); |
| 9 } else { | 9 } else { |
| 10 paragraph.appendChild(document.createTextNode(message)); | 10 paragraph.appendChild(document.createTextNode(message)); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 print(""); | 28 print(""); |
| 29 print("===button==="); | 29 print("===button==="); |
| 30 | 30 |
| 31 // Make sure that accessing selectionStart and selectionEnd on | 31 // Make sure that accessing selectionStart and selectionEnd on |
| 32 // the button throws exceptions. | 32 // the button throws exceptions. |
| 33 elt = document.getElementById("button"); | 33 elt = document.getElementById("button"); |
| 34 testButtonSelectionAccess(elt, ".selectionStart"); | 34 testButtonSelectionAccess(elt, ".selectionStart"); |
| 35 testButtonSelectionAccess(elt, ".selectionStart = 0"); | 35 testButtonSelectionAccess(elt, ".selectionStart = 0"); |
| 36 testButtonSelectionAccess(elt, ".selectionEnd"); | 36 testButtonSelectionAccess(elt, ".selectionEnd"); |
| 37 testButtonSelectionAccess(elt, ".selectionEnd = 0"); | 37 testButtonSelectionAccess(elt, ".selectionEnd = 0"); |
| 38 testButtonSelectionAccess(elt, ".selectionDirection"); |
| 39 testButtonSelectionAccess(elt, ".selectionDirection = 'none'"); |
| 38 // Make sure that setSelectionRange is defined on the button ele
ment, | 40 // Make sure that setSelectionRange is defined on the button ele
ment, |
| 39 // but throws an exception if called. | 41 // but throws an exception if called. |
| 40 if (elt.setSelectionRange != undefined) { | 42 if (elt.setSelectionRange != undefined) { |
| 41 print("button.setSelectionRange defined"); | 43 print("button.setSelectionRange defined"); |
| 42 testButtonSelectionAccess(elt, ".setSelectionRange(0,0)"); | 44 testButtonSelectionAccess(elt, ".setSelectionRange(0,0)"); |
| 43 } | 45 } |
| 44 } | 46 } |
| 45 function testElt(elt) | 47 function testElt(elt) |
| 46 { | 48 { |
| 47 // make sure that setSelectionRange is defined | 49 // make sure that setSelectionRange is defined |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 <hr /> | 130 <hr /> |
| 129 <form> | 131 <form> |
| 130 <textarea id="text"></textarea> | 132 <textarea id="text"></textarea> |
| 131 <input type="text" id="input" /> | 133 <input type="text" id="input" /> |
| 132 <input type="button" id="button" /> | 134 <input type="button" id="button" /> |
| 133 </form> | 135 </form> |
| 134 <hr /> | 136 <hr /> |
| 135 <p id="console"></p> | 137 <p id="console"></p> |
| 136 </body> | 138 </body> |
| 137 </html> | 139 </html> |
| OLD | NEW |