WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED CONFIGURATION CHANGED
15581
Event handler ambiguity
https://bugs.webkit.org/show_bug.cgi?id=15581
Summary
Event handler ambiguity
George Staikos
Reported
2007-10-20 15:26:50 PDT
This code seems to behave differently in every browser I tested, and behavior in WebKit has been changing between versions. What should we be doing? <html><head><title>pressed</title> <script type=text/javascript> function ev_onclick() { document.write("Generated from script 1"); } function ev_onsubmit() { document.write("Generated from script 2"); } </script> <body> <form onsubmit=ev_onsubmit() action="" method=post><input onclick=ev_onclick() type=submit value="Submit Query"> </form><br> </body></html>
Attachments
chrome 124.0.6367.60, submit query.
(610.69 KB, image/png)
2024-04-22 14:15 PDT
,
Frances Cornwall
no flags
Details
chrome 124.0.6367.60 generated from script 1
(613.80 KB, image/png)
2024-04-22 14:17 PDT
,
Frances Cornwall
no flags
Details
firefox 124.0.2 generated from script 1
(612.30 KB, image/png)
2024-04-22 14:19 PDT
,
Frances Cornwall
no flags
Details
firefox 124.0.2 submit query
(610.89 KB, image/png)
2024-04-22 14:20 PDT
,
Frances Cornwall
no flags
Details
safari 17.4.1 submit query
(587.15 KB, image/png)
2024-04-22 14:22 PDT
,
Frances Cornwall
no flags
Details
safari 17.4.1 generated from script 1
(590.26 KB, image/png)
2024-04-22 14:25 PDT
,
Frances Cornwall
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
David Kilzer (:ddkilzer)
Comment 1
2007-10-20 19:32:44 PDT
(In reply to
comment #0
)
> This code seems to behave differently in every browser I tested, and behavior > in WebKit has been changing between versions. What should we be doing?
What does each browser do that you've tested?
George Staikos
Comment 2
2007-10-20 20:49:27 PDT
Firefox displays the submit handler and loads forever Opera, Konqueror display the submit handler and stop Safari 2 goes blank WebKit recent trunk goes back to the form
Ian 'Hixie' Hickson
Comment 3
2007-10-23 01:11:23 PDT
The click ev_onevent() function should fire first when you click the button. It replaces the document with a new document, and that ends that. So you should end up with a document that just says "Generated from script 1". Ok so I wrote that based on just my knowledge of HTML5. Now for reality. I tested IE7 and Mozilla trunk, and luckily for my credibility, both do exactly what I just described. Score!
Frances Cornwall
Comment 4
2024-04-22 10:43:30 PDT
I confirm that the above code behaves similarly in browsers. I tested in Chrome 124.0.6367.60, Firefox 124.0.2, and Safari 17.4.1. A button "Submit Query" gets displayed and the ev_onclick() function fires when clicking on the button and it is replaced with a new document "Generated from script 1".
Frances Cornwall
Comment 5
2024-04-22 14:15:52 PDT
Created
attachment 471046
[details]
chrome 124.0.6367.60, submit query.
Frances Cornwall
Comment 6
2024-04-22 14:17:33 PDT
Created
attachment 471047
[details]
chrome 124.0.6367.60 generated from script 1
Frances Cornwall
Comment 7
2024-04-22 14:19:46 PDT
Created
attachment 471048
[details]
firefox 124.0.2 generated from script 1
Frances Cornwall
Comment 8
2024-04-22 14:20:27 PDT
Created
attachment 471049
[details]
firefox 124.0.2 submit query
Frances Cornwall
Comment 9
2024-04-22 14:22:16 PDT
Created
attachment 471050
[details]
safari 17.4.1 submit query
Frances Cornwall
Comment 10
2024-04-22 14:25:16 PDT
Created
attachment 471051
[details]
safari 17.4.1 generated from script 1
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug