W3C home > Mailing lists > Public > public-html@w3.org > September 2007

Re: Image controls and form submission

From: Simon Pieters <simonp@opera.com>
Date: Fri, 14 Sep 2007 14:29:00 +0200
To: "Boris Zbarsky" <bzbarsky@mit.edu>, "public-html@w3.org" <public-html@w3.org>
Message-ID: <op.tym8ymdkidj3kv@hp-a0a83fcd39d2.palace.opera.no>

On Fri, 14 Sep 2007 08:19:50 +0200, Boris Zbarsky <bzbarsky@MIT.EDU> wrote:

> Looking at Web Forms 2, the text covering submission of image controls  
> says:
>    Image buttons, during this step, must be handled as if they were
>    two controls, one with the control's name with .x appended, whose
>    value is the x coordinate selected by the user, and the other with
>    the control's name with .y appended, whose value is the y coordinate
>    selected by the user.
> This leaves the following questions open:
> 1)  What if the user doesn't explicitly select any coordinates?  For
>      example, the user triggers the control by tabbing to the image
>      and hitting enter.
> 2)  What if the image has been replaced by inline alt text?

3) Should a border on the image affect the coordinates? (The answer is yes  
if you ask browsers.)

The same questions apply to server side image maps.

> In terms of UA behavior, Gecko currently always sends "x=&y=" for case 2  
> (no matter how the control is triggered) and sends "x=0&y=0" for case 1  
> if we're not in case 2.  This seems to cause problems in some cases,  
> however: see <https://bugzilla.mozilla.org/show_bug.cgi?id=388794>.
> As far as I can tell, Opera always sends "x=0&y=0" for case 1 and  
> doesn't do anything special in case 2: if you click somewhere in the alt  
> text, the coordinates of the click with respect to the alt text are sent  
> to the server. That seems to defeat the purpose of having coordinates in  
> the submission in the first place (which is to figure out where in the  
> image the user clicked).
> What do other UAs do?

For <input type=image>...

IE, Opera, Gecko and WebKit all seem to agree on case 1.

For case 2, Gecko is the odd one out; IE and WebKit do what Opera does.

For <a href><img ismap>...

For case 1, Opera, WebKit and Gecko don't append anything to the URL. IE  
appends "?0,0".

For case 2, Gecko doesn't follow the link at all if you click on the  
image's alt text. IE, Opera and WebKit append the coordinates as "?X,Y" to  
the URL.

> What sort of behavior do we want?  In Gecko, I'm somewhat tempted to  
> make case 2 always do the same thing as case 1: send "x=0&y=0".  That  
> should fix the compat problem we've run into, while still not selecting  
> any "real" pixel in the image... maybe.

Makes sense.

Simon Pieters
Opera Software
Received on Friday, 14 September 2007 12:29:11 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 9 October 2021 18:44:21 UTC