OLD | NEW |
(Empty) | |
| 1 <script src="../../fast/js/resources/js-test-pre.js"></script> |
| 2 <div id="container"> |
| 3 <p id="description"></p> |
| 4 <div id="sample1" contenteditable="true">editable</div> |
| 5 <div id="sample2" contenteditable="false">uneditable</div> |
| 6 </div> |
| 7 </div> |
| 8 <script> |
| 9 function $(id) { return document.getElementById(id); } |
| 10 description('Test setting CSSStyleDeclaration.webkitUserStyle'); |
| 11 |
| 12 var selection = window.getSelection(); |
| 13 function setSelection(node) |
| 14 { |
| 15 var range = document.createRange(); |
| 16 range.selectNodeContents(node); |
| 17 selection.empty(); |
| 18 selection.addRange(range); |
| 19 } |
| 20 |
| 21 // user-select:none in editable element |
| 22 $('sample1').style.webkitUserSelect = 'none'; |
| 23 setSelection($('sample1')); |
| 24 shouldBeEqualToString('selection.type', 'Range'); |
| 25 |
| 26 // user-select:none in uneditable element |
| 27 $('sample2').style.webkitUserSelect = 'none'; |
| 28 setSelection($('sample2')); |
| 29 shouldBeEqualToString('selection.type', 'None'); |
| 30 |
| 31 if (window.testRunner) |
| 32 $('container').outerHTML = ''; |
| 33 </script> |
| 34 <script src="../../fast/js/resources/js-test-post.js"></script> |
OLD | NEW |