[webkit-dev] query on eventsender

Antaryami Pandia xqb748 at motorola.com
Tue Nov 22 02:35:23 PST 2011


Hi All,
I have a query regarding eventsender - can eventsender be used to send
click events on options of a drop down combo box.
I have written a script as follows:-

<select id="wut">
    <option value="1" onClick="clicked()">One</option>
    <option value="2" onClick="clicked()">Two</option>
    ............
</select>
<div id='console'> Result: </div>
<script>
function clicked() {
    var testEle = document.getElementById("wut");
    document.getElementById("console").innerHTML='PASS: onClick on Option
element is successfull.';
}

function test() {
    if (window.layoutTestController) {
        layoutTestController.dumpAsText();
    }

    if (window.eventSender) {
        var testEle = document.getElementById("wut");

        // Send click to the selece box
        var posX = testEle.offsetLeft+testEle.offsetWidth/2;
        var posY = testEle.offsetTop+testEle.offsetHeight/2;
        eventSender.mouseMoveTo(posX, posY);
        eventSender.mouseDown();
        eventSender.mouseUp();

        // Now assuming the combo box is displayed, send another click
event on the option element.
        eventSender.leapForward(1000);
        eventSender.mouseMoveTo(posX, posY+40);
        eventSender.mouseDown();
        eventSender.mouseUp();
   }
}
</script>

But this doesn't works as expected.
This is regarding webkit issue:- 47368.

Regards,
-Antaryami
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20111122/9fb76408/attachment.html>


More information about the webkit-dev mailing list