[whatwg] Form controls inside a label but not labelled by it

Anne van Kesteren annevk at opera.com
Thu Feb 17 05:15:45 PST 2011


On Thu, 17 Feb 2011 13:10:09 +0100, Mounir Lamouri  
<mounir.lamouri at gmail.com> wrote:
> According to a comment of Hixie in [1], this case has been handled by
> the specs in 2004 but it doesn't seem to be any more and UA's have a
> very different behaviour here:
> - Firefox: focus and activate the labelled element ;
> - Webkit: focus the form control and activate the labelled element ;
> - Presto and IE9 RC: focus the form control (doesn't activate the
> labelled element).
>
> I think Webkit's behaviour makes the more sense here and it would be
> nice to have it specified.

The spec defines the Opera/IE behavior which I think is actually better.  
If you nest elements with activation behavior only the innermost is  
activated. You can also test this by e.g. nesting <a> elements and see  
which link is followed.


> [1] https://bugzilla.mozilla.org/show_bug.cgi?id=213519


-- 
Anne van Kesteren
http://annevankesteren.nl/



More information about the whatwg mailing list