[Webkit-unassigned] [Bug 52149] New: Returning false from onsubmit with image maps doesn't suppress coordinates

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 10 08:01:12 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=52149

           Summary: Returning false from onsubmit with image maps doesn't
                    suppress coordinates
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Forms
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: agl at chromium.org


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

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list