OLD | NEW |
1 <select id="bomb" onfocus="this.parentNode.removeChild(this)"> | 1 <select id="bomb" onfocus="this.parentNode.removeChild(this)"> |
2 <option>Clicking on this select element should not crash</option> | 2 <option>Clicking on this select element should not crash</option> |
3 </select> | 3 </select> |
4 <h2>Layout test for <a href='https://bugs.webkit.org/show_bug.cgi?id=23858'>bug
23858</a></h2> | 4 <h2>Layout test for <a href='https://bugs.webkit.org/show_bug.cgi?id=23858'>bug
23858</a></h2> |
5 <p>If this page is displayed without crashing then the test has passed.</p> | 5 <p>If the select can be clicked without crashing then the test has passed.</p> |
6 <script> | 6 <script> |
7 if (window.testRunner) | 7 if (window.testRunner) |
8 testRunner.dumpAsText(); | 8 testRunner.dumpAsText(); |
9 | 9 |
10 var select = document.getElementById('bomb'); | 10 var select = document.getElementById('bomb'); |
11 var mouseEvent = document.createEvent("MouseEvents"); | 11 var rect = select.getBoundingClientRect(); |
12 mouseEvent.initMouseEvent("mousedown", true, true, document.defaultView, 1,
select.offsetLeft + 1, select.offsetTop + 1, select.offsetLeft + 1, select.offse
tTop + 1, false, false, false, false, 0, document); | 12 if (window.eventSender) { |
13 select.dispatchEvent(mouseEvent); | 13 eventSender.mouseMoveTo(rect.left + 1, rect.top + 1); |
| 14 eventSender.mouseDown(0); |
| 15 } |
14 </script> | 16 </script> |
OLD | NEW |