UNCONFIRMED Bug 49424
Calling actions twice for <input type="submit" /> and <button type="submit" /> in a <form>
https://bugs.webkit.org/show_bug.cgi?id=49424
Summary Calling actions twice for <input type="submit" /> and <button type="submit" /...
Dai Mikurube
Reported 2010-11-11 21:22:26 PST
How to reproduce: <form action="javascript: handler()" method="get"> <button id="pass1" type="submit" /> <input id="pass2" type="submit" /> </form> <script> var count = 0; function handler() { count++; } var input = document.getElementById('pass2'); input.click(); console.log(count); </script> Expected: count will be 1 after input.click(); Actual: count will be 2.
Attachments
Dai Mikurube
Comment 1 2010-11-11 21:49:44 PST
For more details, handler() was incorrectly called twice in case of clicking passC2, passD1, passE1, passE3, passF2 and passG3. Otherwise once. I guess that clicking <input type="submit"> coexisting with other <button type="submit">s causes double calling. <form action="javascript: handler()" method="get"> <input id="passA1" type="submit" /> <input id="passA2" type="submit" /> </form> <form action="javascript: handler()" method="get"> <button id="passB1" type="submit" /> <button id="passB2" type="submit" /> </form> <form action="javascript: handler()" method="get"> <button id="passC1" type="submit" /> <input id="passC2" type="submit" /> </form> <form action="javascript: handler()" method="get"> <input id="passD1" type="submit" /> <button id="passD2" type="submit" /> </form> <form action="javascript: handler()" method="get"> <input id="passE1" type="submit" /> <button id="passE2" type="submit" /> <input id="passE3" type="submit" /> </form> <form action="javascript: handler()" method="get"> <button id="passF1" type="submit" /> <input id="passF2" type="submit" /> <button id="passF3" type="submit" /> </form> <form action="javascript: handler()" method="get"> <button id="passG1" type="submit" /> <button id="passG2" type="submit" /> <input id="passG3" type="submit" /> </form>
Alexey Proskuryakov
Comment 2 2010-11-12 12:13:12 PST
We have many bugs about this, and most or all likely have a single root cause. See bug 13012, bug 34315, bug 33513, bug 9715. There are probably more, dglazkov may remember those.
Dimitri Glazkov (Google)
Comment 3 2010-11-12 12:21:10 PST
(In reply to comment #2) > We have many bugs about this, and most or all likely have a single root cause. > > See bug 13012, bug 34315, bug 33513, bug 9715. There are probably more, dglazkov may remember those. Yep. See https://bugs.webkit.org/showdependencytree.cgi?id=39021 for a full-on overview of the problem. More importantly, if you wish to contribute cycles into the effort, I'd be more than happy to help with guidance.
Dai Mikurube
Comment 4 2010-11-14 21:24:59 PST
(In reply to comment #3) Hi Dimitri, Alexey, Thank you for letting me know. I posted it since I just found the behavior with <input>s and <button>s when working for other bugs. It looks like having a deep cause... I'll try it after finishing other bugs which I'm contributing to.
Dai Mikurube
Comment 5 2010-12-01 20:07:24 PST
(In reply to comment #4) I'll be starting to work on them.
Dai Mikurube
Comment 6 2010-12-02 22:53:50 PST
(In reply to comment #5) I found it works correctly on the current version, great! (I still couldn't find which patch fixed this bug.) I'll be starting on the bugs at https://bugs.webkit.org/showdependencytree.cgi?id=39021 . Dimitri, I'm wondering if you could give me a kind of guidance about "a single root cause" of them...
Note You need to log in before you can comment on or make changes to this bug.