[PATCH] Last version of the "fix label form focus" (59489)

Germain Garand germain at ebooksfrance.org
Thu Jul 8 15:06:55 BST 2004


Le Jeudi 08 Juillet 2004 10:44, Tobias Anton a écrit :
> On Donnerstag, 8. Juli 2004 01:44, bj at altern.org wrote:
> > Grmbl!
> > Sorry for spamming this list with this ever changing patch, but at least
> > I am learning things!
> >
> > Now works also with <select> and <textarea>...
> > Didn't add a defaultEventHandler method for HTMLTextAreaElementImpl and
> > HTMLSelectElementImpl, since all is needed is to focus them... If that's
> > another of my bad ideas, let me know.
>
> Basically, that's a good idea. But it would still be better to react on the
> activate event than on the click event.

As much as I agree, I don't think it is a good idea to do that change right 
now. There's nothing fundamentally broken with the simulated click approach 
and we are at a point where we should strictly focus on bugfixing.

I'd rather advocate a dumb approach, where, if we are to simulate a click, 
then we should just do it right.

The dom HTML spec says the HTMLInputElement::click() method should simulate a 
full blown mouse-click on the element - it doesn't say it should dispatch a 
CLICK_EVENT. 
So an obvious solution would be to dispatch a MOUSEDOWN, then a MOUSEUP then a 
CLICK from there, so that the logic doesn't need to be changed at all.

[...]
> The disadvantage of the click events is, among others, that we must pass
> (0,0) mouse coordinates, which might confuse event handlers that expect
> sane values in the mouse coordinates field.

mmh, it's 0,0 relative to the _target_, so that's perfectly sane in my book.

Just my two cents,
Greetings,
Germain




More information about the kfm-devel mailing list