OLD | NEW |
(Empty) | |
| 1 <head> |
| 2 <style> |
| 3 .sample { |
| 4 -webkit-user-select: none; |
| 5 user-select: none; |
| 6 } |
| 7 </style> |
| 8 </head> |
| 9 <body> |
| 10 <script src="../js/resources/js-test-pre.js"></script> |
| 11 <div id="container"> |
| 12 <p id="description"></p> |
| 13 Manual step |
| 14 <ol> |
| 15 <li>Click text input/textarea</li> |
| 16 <li>Type text</li> |
| 17 </ol> |
| 18 <input class="sample" placeholder="edit me!" value=""><br> |
| 19 <textarea class="sample" placeholder="edit me!" ></textarea> |
| 20 </div> |
| 21 <script> |
| 22 description('Tests user-select:none doesn\'t affect editing'); |
| 23 function $(id) { return document.getElementById(id); } |
| 24 |
| 25 var sample; |
| 26 var expectedText = 'wxy'; |
| 27 var samples = document.querySelectorAll('.sample'); |
| 28 for (var i = 0; i < samples.length; ++i) { |
| 29 sample = samples[i]; |
| 30 sample.focus(); |
| 31 if (window.eventSender) { |
| 32 for (var j = 0; j < expectedText.length; ++j) |
| 33 eventSender.keyDown(expectedText[j]); |
| 34 shouldBeEqualToString('sample.value', expectedText); |
| 35 } |
| 36 } |
| 37 |
| 38 if (window.testRunner) |
| 39 $('container').outerHTML = ''; |
| 40 </script> |
| 41 <script src="../js/resources/js-test-post.js"></script> |
| 42 </body> |
OLD | NEW |