RESOLVED WONTFIX 19983
DOM event handler onfocus not fired
https://bugs.webkit.org/show_bug.cgi?id=19983
Summary DOM event handler onfocus not fired
Calvin Anderson
Reported 2008-07-10 15:23:17 PDT
I. Steps: ----------- 1. Launch Safari 2. Launch the attached testcase 3. Try focussing the button (or) clicking on the button II. Issue: ----------------- Alert box should show up when onfocus fires. But it doesn't happen in Safari. III. Other browsers: ----------------------- IE7 : ok FF3 : ok Opera 9.50: ok IV. Safari nightly tested: version 3.1.1(525.17 )- r34603. Not working properly on Safari. V. Safari screenshot : Not Avalible
Attachments
reduction.zip (534 bytes, application/octet-stream)
2008-07-10 15:23 PDT, Calvin Anderson
no flags
Tests the onfocus handler for a div (1.30 KB, text/html)
2009-06-29 14:52 PDT, Jessie Berlin
no flags
Shows how the onfocus handler does get called if the tabindex is set to -1 (1.36 KB, text/html)
2009-06-30 20:37 PDT, Jessie Berlin
no flags
Calvin Anderson
Comment 1 2008-07-10 15:23:19 PDT
Created attachment 22215 [details] reduction.zip
swethanagaraj
Comment 2 2009-05-21 21:53:37 PDT
Hi, I have been analysing this bug, these are the observation made: In webkit\webcore\dom\eventtargetnode.cpp file, under EventTargetNode::handleLocalEvents(Event* event, bool useCapture) method if (r.eventType() == event->type().....) condition fails since the r.eventType() is "focus" and event->type() is "click". so the condition fails hence we wont get the alert message. I added event->type()==eventNames().clickEvent ORed with the r.eventType() == event->type()in the if statement. This would solve the problem.
Jessie Berlin
Comment 3 2009-06-29 14:52:44 PDT
Created attachment 32021 [details] Tests the onfocus handler for a div It looks like the problem has moved to Node::handleLocalEvents as EventTargetNode no longer exists (http://trac.webkit.org/changeset/40675).
Jessie Berlin
Comment 4 2009-06-30 20:37:53 PDT
Created attachment 32108 [details] Shows how the onfocus handler does get called if the tabindex is set to -1 In accordance with the HTML5 spec, the onfocus handler of a div will only be called if that div has a tabIndex set: http://dev.w3.org/html5/spec/Overview.html#focus
Note You need to log in before you can comment on or make changes to this bug.