OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <script src="../../../resources/js-test.js"></script> |
| 4 <style> |
| 5 span { |
| 6 user-select: none; |
| 7 -webkit-user-select: none; |
| 8 } |
| 9 </style> |
| 10 <div> |
| 11 Select, some text from this line!!! |
| 12 </div> |
| 13 <label class="label"> |
| 14 <input type="checkbox"/> |
| 15 <span id='span'>Click Me</span> |
| 16 </label> |
| 17 <div id='console'></div> |
| 18 |
| 19 <script> |
| 20 description('Tests that the click event is passed when selection is disabaled' + |
| 21 ' on label'); |
| 22 |
| 23 var span = document.getElementById('span'); |
| 24 testWithDoubleClick(span); |
| 25 shouldBeEqualToString('window.getSelection().toString()', ''); |
| 26 |
| 27 var div = document.querySelector('div'); |
| 28 testWithDoubleClick(div); |
| 29 shouldBeEqualToString('window.getSelection().toString()', 'Select'); |
| 30 |
| 31 shouldBeFalse("document.querySelector('input').checked"); |
| 32 |
| 33 span.click(); |
| 34 shouldBeTrue("document.querySelector('input').checked"); |
| 35 |
| 36 span.click(); |
| 37 shouldBeFalse("document.querySelector('input').checked"); |
| 38 |
| 39 div.style.display = 'none'; |
| 40 span.style.display = 'none'; |
| 41 |
| 42 function testWithDoubleClick(element) |
| 43 { |
| 44 eventSender.mouseMoveTo(element.offsetLeft, element.offsetTop); |
| 45 eventSender.mouseDown(); |
| 46 eventSender.mouseUp(); |
| 47 eventSender.mouseDown(); |
| 48 eventSender.mouseUp(); |
| 49 } |
| 50 </script> |
OLD | NEW |