We're working on some form code (we'll release it to the group soon) and we
discovered a bug, or possible hole in Webkit, specifically in the request()
object.

Right now, when you make a form, you make a submit button like this:
<input type="submit" id="submit" name="_action_submit" value="go" />

When you click on that button, a field is added to the posted variables that
has the key of '_action_submit'. WebKit looks for that '_action_' and what
comes after it (in my case, 'submit').

It then checks the .actions() method to see if 'submit' is ok to run, as a
method.

Then, it runs .submit().

No problems so far. It's an elegant setup.

Now, if we try and make an IMAGE submit button, (as seen on Amazon, for
example) like this:
<input type="image" id="submit" name="_action_submit" value="go"
src="button.gif" height="20" width="20" />
we've got a problem.

The way image input works browsers is that the browser splits the field into
two, and you end up getting something like this in fields:

_action_submit.x=6,_action_submit.y=8

Which is the X and Y coordinate that the user clicked on when they clicked
the image (if they hit enter instead of clicking, you get 0,0).

This sneaks by Webkit, as 'submit.x' doesn't correspond to anything in
actions(). If you add it to actions(), you've got a problem, because you
can't have a method name that has a period character.

What SHOULD happen is that webkit should notice that it's really a compound
value and make it into a tuple or something, turning it into
_action_submit=(6,8).

What does everyone think?

I can probably patch this, if people think it's the right thing to do.

- Matt

P.S. If one uses the 'old' way of doing actions... methodNameForAction() one
can hijack the lookup table to conform the names, but you'd lose the values.
And, we should make it work with the 'new' way.


_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to