OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 <p id="description"></p> | 7 <p id="description"></p> |
8 <div><input id="dummy"></div> | 8 <div><input id="dummy"></div> |
9 <div id="tests"><input value="hello"><textarea>hello</textarea></div> | 9 <div id="tests"><input value="hello"><textarea>hello</textarea></div> |
10 <div id="console"></div> | 10 <div id="console"></div> |
(...skipping 21 matching lines...) Expand all Loading... |
32 assertDirection(expectedDirection, element, 'hiding the element'); | 32 assertDirection(expectedDirection, element, 'hiding the element'); |
33 element.style.display = null; | 33 element.style.display = null; |
34 } | 34 } |
35 | 35 |
36 function runTest(element, platform) { | 36 function runTest(element, platform) { |
37 debug(element.localName + ' on ' + platform); | 37 debug(element.localName + ' on ' + platform); |
38 element.focus(); | 38 element.focus(); |
39 | 39 |
40 var noneOnMacAndForwardOnOthers = (platform == 'Mac') ? 'none' : 'forward'; | 40 var noneOnMacAndForwardOnOthers = (platform == 'Mac') ? 'none' : 'forward'; |
41 | 41 |
| 42 var newElement = document.createElement(element.tagName); |
| 43 assertDirection(noneOnMacAndForwardOnOthers, newElement, 'just creating'); |
| 44 |
42 element.setSelectionRange(1, 2); | 45 element.setSelectionRange(1, 2); |
43 assertDirection(noneOnMacAndForwardOnOthers, element, 'focusing and setting
selection by setSelectionRange(1, 2)'); | 46 assertDirection(noneOnMacAndForwardOnOthers, element, 'focusing and setting
selection by setSelectionRange(1, 2)'); |
44 testCache(noneOnMacAndForwardOnOthers, element); | 47 testCache(noneOnMacAndForwardOnOthers, element); |
45 | 48 |
46 element.focus(); | 49 element.focus(); |
47 element.setSelectionRange(1, 2, 'forward'); | 50 element.setSelectionRange(1, 2, 'forward'); |
48 assertDirection('forward', element, 'focusing and setting selection by setSe
lectionRange(1, 2, "forward")'); | 51 assertDirection('forward', element, 'focusing and setting selection by setSe
lectionRange(1, 2, "forward")'); |
49 testCache('forward', element); | 52 testCache('forward', element); |
50 | 53 |
51 element.setSelectionRange(1, 2, 'backward'); | 54 element.setSelectionRange(1, 2, 'backward'); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 runTestFor('Unix'); | 101 runTestFor('Unix'); |
99 } else | 102 } else |
100 runTestFor(navigator.platform.indexOf('Mac') >= 0 ? 'Mac' : 'Win'); | 103 runTestFor(navigator.platform.indexOf('Mac') >= 0 ? 'Mac' : 'Win'); |
101 | 104 |
102 tests.style.display = 'none'; | 105 tests.style.display = 'none'; |
103 dummy.parentNode.style.display = 'none'; | 106 dummy.parentNode.style.display = 'none'; |
104 | 107 |
105 </script> | 108 </script> |
106 </body> | 109 </body> |
107 </html> | 110 </html> |
OLD | NEW |