OLD | NEW |
1 <html> | 1 <html> |
2 <body> | 2 <body> |
3 <div> | 3 <div> |
4 <p id="text"> | 4 <p id="text"> |
5 This tests that the methods that set selection colors for Linux work correctly. | 5 This tests that the methods that set selection colors for Linux work correctly. |
6 </p> | 6 </p> |
7 <p>(All the text in the above sentence should be highlighted red with green text
)</p> | 7 <p>(All the text in the above sentence should be highlighted red with green text
)</p> |
8 </div> | 8 </div> |
9 <script> | 9 <script> |
10 if (window.testRunner) { | 10 if (window.testRunner) { |
11 testRunner.forceRedSelectionColors() | 11 testRunner.forceRedSelectionColors() |
12 } | 12 } |
13 | 13 |
14 var div = document.getElementById("text"); | 14 var div = document.getElementById("text"); |
15 var sel = window.getSelection(); | 15 var sel = window.getSelection(); |
16 var range = document.createRange(); | 16 var range = document.createRange(); |
17 range.selectNode(div); | 17 range.selectNode(div); |
18 sel.addRange(range); | 18 sel.addRange(range); |
19 </script> | 19 </script> |
20 </body> | 20 </body> |
21 </html> | 21 </html> |
OLD | NEW |