WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
52149
Returning false from onsubmit with image maps doesn't suppress coordinates
https://bugs.webkit.org/show_bug.cgi?id=52149
Summary
Returning false from onsubmit with image maps doesn't suppress coordinates
Adam Langley
Reported
2011-01-10 08:01:12 PST
There is apparently a common idiom for suppressing the submission of coordinates from an image map which doesn't work in WebKit. This bug report is taken from [1]. Reproduces in Chrome nightly and Safari. [This is a common idiom] to work around imagemap behavior: onsubmit="this.submit(); return false;"> This prevents submit.x and submit.y from showing up in the resulting URL (because the browser, when the image is clicked, appends to the URL the X and Y coordinates of the pixel clicked within the image) Here is your example, modified to capture this usage: <html> <head> <script> function f() { return false; } </script> </head> <body> <form method="GET" action="/" onsubmit="this.submit(); return f();"> <input type="text" name="test"> <input type="image" src="dummy.gif" alt="Submit" title="Submit" /> </form> </body> </html> The following browser/OS combos exhibit the symptom described by the original poster in my testing, using exactly the code above: * Chrome 9.0.597.19 on Ubuntu 10.04 x86 (Firefox 3.6.13 works as expected) * Chrome 9.0.576.0 on recent Windows XP (IE8 works as expected; FF 3.6.13 passes x=0, y=0 regardless of where clicked) * Chrome 10.0.612.1 on Windows 7 Home Premium (IE8 and FF 3.6.13 work as expected) Both returning false directly in the onsubmit action, as well as calling a function that returns false, produce the symptom. These references contain workarounds using CSS or Javascript: stackoverflow.com/questions/1244009 www.webmasterworld.com/html/3545351.htm Unfortunately, they are workarounds that sidestep using images as a "image" input types, and do not address the underlying "return false" issue. [1]
http://www.google.com/support/forum/p/Chrome/thread?fid=7abe8874e21c2d8e0004995f2b6c53bd&hl=en
Attachments
Add attachment
proposed patch, testcase, etc.
Alexey Proskuryakov
Comment 1
2011-01-10 13:59:04 PST
Looks like a duplicate of
bug 13012
, or one of the many other bugs we track on nested submission.
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