This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
+++ This bug was initially created as a clone of Bug #24278 +++ "Phrasing content, but with no descendant labelable elements unless it is the element's labeled control, and no descendant label elements." http://www.w3.org/html/wg/drafts/html/master/forms.html#the-label-element example: <label for="test"><a href="http://google.com">google</a></label><input id="test" type="checkbox"> or if you prefer a real world example: <input id="boston_region" type="checkbox" name="locations" value="boston_region"> <label for="boston_region"> <a id="x:219752177.6:mkr:dtnContent" class="igdt_Node igdt_NodeParent" href="#" title="BOR - Boston Region" mkr="dtnContent">BOR - Boston Region</a> </label> this breaks the expected behaviour of a label activating the control in IE/chrome/firefox. suggest changing to "no descendant interactive elements"
At least in Chrome, the link still works: http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2736 I still need to test other browsers though.
(In reply to Ian 'Hixie' Hickson from comment #1) > At least in Chrome, the link still works: > http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2736 > > I still need to test other browsers though. this breaks the expected behaviour of a label activating the control in IE/chrome/firefox. further discussion/checking has lead me to think that only when the label text is wholly contained within the link text that it presents a problem http://lists.w3.org/Archives/Public/public-html/2014Jan/0063.html
Tested on Firefox too, and Firefox is also consistent with the spec. I'm not understanding what the problem is here. Can you elaborate? Obviously if the label only contains a link and a control, there's no text to click on that acts as a label, but where's the problem? Or are you saying that if someone used a label, they probably didn't mean to not have any non-link text? I the latter, then I think it's good to allow authors to use the <label> element even when it doesn't do anything useful, because it allows for consistent markup in the case of most labels not being a link but some being a link. For example, this very bug page does something much like that.
Commit pushed to master at https://github.com/w3c/html https://github.com/w3c/html/commit/11c025f70bf7364e37cec508592c99916f92c3c8 added advice about effect of linked labels see bug 24279
(In reply to github bugzilla bot from comment #4) > Commit pushed to master at https://github.com/w3c/html > > https://github.com/w3c/html/commit/11c025f70bf7364e37cec508592c99916f92c3c8 > added advice about effect of linked labels > > see bug 24279 whoops sorry added to wrong bug
Please reopen when responding to comment 3, thanks.