| 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 <script src="resources/js-test-selection-shared.js"></script> | 5 <script src="resources/js-test-selection-shared.js"></script> |
| 6 </head> | 6 </head> |
| 7 <body> | 7 <body> |
| 8 <p id="description"></p> | 8 <p id="description"></p> |
| 9 <div id="console"></div> | 9 <div id="console"></div> |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 var selection = window.getSelection(); | 33 var selection = window.getSelection(); |
| 34 selection.empty(); | 34 selection.empty(); |
| 35 | 35 |
| 36 if (node.localName == 'div') { | 36 if (node.localName == 'div') { |
| 37 var container = node.childNodes[2]; | 37 var container = node.childNodes[2]; |
| 38 var range = document.createRange(); | 38 var range = document.createRange(); |
| 39 range.setStart(container, container.data.search('ine 2')); | 39 range.setStart(container, container.data.search('ine 2')); |
| 40 range.setEnd(container, range.startOffset + 'in'.length); | 40 range.setEnd(container, range.startOffset + 'in'.length); |
| 41 selection.addRange(range); | 41 selection.addRange(range); |
| 42 } else { | 42 } else { |
| 43 node.focus(); |
| 43 node.selectionDirection = 'none'; | 44 node.selectionDirection = 'none'; |
| 44 node.selectionStart = node.value.search('ine 2'); | 45 node.selectionStart = node.value.search('ine 2'); |
| 45 node.selectionEnd = node.selectionStart + 'in'.length; | 46 node.selectionEnd = node.selectionStart + 'in'.length; |
| 46 } | 47 } |
| 47 } | 48 } |
| 48 | 49 |
| 49 function runTestsAndVerify(name, selectionModifier, expectedDirection, expectedT
ext) { | 50 function runTestsAndVerify(name, selectionModifier, expectedDirection, expectedT
ext) { |
| 50 var currentTest = makeTest(name, selectionModifier, expectedDirection, expec
tedText); | 51 var currentTest = makeTest(name, selectionModifier, expectedDirection, expec
tedText); |
| 51 | 52 |
| 52 currentTest('no action'); | 53 currentTest('no action'); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 runTestsFor('win'); | 137 runTestsFor('win'); |
| 137 runTestsFor('unix'); | 138 runTestsFor('unix'); |
| 138 runTestsFor('android'); | 139 runTestsFor('android'); |
| 139 | 140 |
| 140 document.getElementById('test').innerHTML = ''; | 141 document.getElementById('test').innerHTML = ''; |
| 141 } | 142 } |
| 142 | 143 |
| 143 </script> | 144 </script> |
| 144 </body> | 145 </body> |
| 145 </html> | 146 </html> |
| OLD | NEW |