RESOLVED FIXED 4573
click DOM method not working on check boxes or radio buttons
https://bugs.webkit.org/show_bug.cgi?id=4573
Summary click DOM method not working on check boxes or radio buttons
Darin Adler
Reported 2005-08-21 17:43:06 PDT
After the recent changes to forms, the "click" DOM method isn't working any more. This is breaking the HTMLInputElement21 test.
Attachments
patch to check on khtmlClick rather than click, not insist on a mouse event (1.60 KB, patch)
2005-08-21 17:51 PDT, Darin Adler
hyatt: review-
Darin Adler
Comment 1 2005-08-21 17:51:10 PDT
Created attachment 3496 [details] patch to check on khtmlClick rather than click, not insist on a mouse event
Darin Adler
Comment 2 2005-08-21 17:51:38 PDT
Comment on attachment 3496 [details] patch to check on khtmlClick rather than click, not insist on a mouse event I need Dave's input on whether this is the right way to fix this.
Maciej Stachowiak
Comment 3 2005-08-28 19:53:30 PDT
The change itself looks ok, however, I think the whole pre-dispatch event handling concept may be bogus. Other browsers will allow the click event handler for a radio button or checkbox to prevent the default action of toggling its checked state.
Maciej Stachowiak
Comment 4 2005-08-28 23:11:54 PDT
Comment on attachment 3496 [details] patch to check on khtmlClick rather than click, not insist on a mouse event Assuming you tested this with both click() and real mouse clicks, r=me. However - our handling here is somewhat wrong. Preventing default in or returning false from a mouse handler will not prevent the checkbox or radio button from being checked, and it should.
Maciej Stachowiak
Comment 5 2005-08-28 23:18:26 PDT
Comment on attachment 3496 [details] patch to check on khtmlClick rather than click, not insist on a mouse event Assuming you tested this with both click() and real mouse clicks, r=me. However - our handling here is somewhat wrong. Preventing default in or returning false from a mouse handler will not prevent the checkbox or radio button from being checked, and it should.
Maciej Stachowiak
Comment 6 2005-08-28 23:34:47 PDT
Comment on attachment 3496 [details] patch to check on khtmlClick rather than click, not insist on a mouse event Assuming you tested this with both click() and real mouse clicks, r=me. However - our handling here is somewhat wrong. Preventing default in or returning false from a mouse handler will not prevent the checkbox or radio button from being checked, and it should.
Dave Hyatt
Comment 7 2005-08-30 15:32:42 PDT
Actually it's much weirder than that. onmousedown preventDefault does not stop checking. onclick preventDefault actually *reverses* the checking/unchecking in WinIE and Firefox. In other words you let the checking/unchecking happen and then undo it! I'm not sure if this is going to be necessary or not... Anyway, r- on the patch since the real bug is just that the click method was sending a KHTML_CLICK and not a real CLICK event.
Dave Hyatt
Comment 8 2005-08-30 15:33:45 PDT
KHTML_CLICK needs to be eliminated as well, since its presence causes onclick to fire at the wrong time, after bubbling has happened in the real DOM. I'm going to file a follow-up bug to eliminate KHTML_CLICK.
Dave Hyatt
Comment 9 2005-08-30 15:57:04 PDT
Fixed.
Note You need to log in before you can comment on or make changes to this bug.