<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>24279</bug_id>
          
          <creation_ts>2014-01-13 10:32:50 +0000</creation_ts>
          <short_desc>should links be allowed inside labels?</short_desc>
          <delta_ts>2014-01-14 19:10:52 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>NEEDSINFO</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          <dependson>24278</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="steve faulkner">faulkner.steve</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>faulkner.steve</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>98318</commentid>
    <comment_count>0</comment_count>
    <who name="steve faulkner">faulkner.steve</who>
    <bug_when>2014-01-13 10:32:50 +0000</bug_when>
    <thetext>+++ This bug was initially created as a clone of Bug #24278 +++

&quot;Phrasing content, but with no descendant labelable elements unless it is the element&apos;s labeled control, and no descendant label elements.&quot;
http://www.w3.org/html/wg/drafts/html/master/forms.html#the-label-element
example:
&lt;label for=&quot;test&quot;&gt;&lt;a href=&quot;http://google.com&quot;&gt;google&lt;/a&gt;&lt;/label&gt;&lt;input id=&quot;test&quot; type=&quot;checkbox&quot;&gt;  

or if you prefer a real world example:

&lt;input id=&quot;boston_region&quot; type=&quot;checkbox&quot; name=&quot;locations&quot; value=&quot;boston_region&quot;&gt;

&lt;label for=&quot;boston_region&quot;&gt;
	&lt;a id=&quot;x:219752177.6:mkr:dtnContent&quot; 
	class=&quot;igdt_Node igdt_NodeParent&quot;  href=&quot;#&quot; 
	title=&quot;BOR - Boston Region&quot; 
	mkr=&quot;dtnContent&quot;&gt;BOR - Boston Region&lt;/a&gt;
&lt;/label&gt;


this breaks the expected behaviour of a label activating the control in IE/chrome/firefox. 

suggest changing to &quot;no descendant interactive elements&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98336</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-01-13 17:18:18 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98339</commentid>
    <comment_count>2</comment_count>
    <who name="steve faulkner">faulkner.steve</who>
    <bug_when>2014-01-13 17:26:52 +0000</bug_when>
    <thetext>(In reply to Ian &apos;Hixie&apos; Hickson from comment #1)
&gt; At least in Chrome, the link still works:
&gt;    http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2736
&gt; 
&gt; 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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98375</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-01-13 23:38:23 +0000</bug_when>
    <thetext>Tested on Firefox too, and Firefox is also consistent with the spec.

I&apos;m not understanding what the problem is here. Can you elaborate?

Obviously if the label only contains a link and a control, there&apos;s no text to click on that acts as a label, but where&apos;s the problem? Or are you saying that if someone used a label, they probably didn&apos;t mean to not have any non-link text? I the latter, then I think it&apos;s good to allow authors to use the &lt;label&gt; element even when it doesn&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98410</commentid>
    <comment_count>4</comment_count>
    <who name="github bugzilla bot">sideshowbarker+gitzilla</who>
    <bug_when>2014-01-14 10:50:03 +0000</bug_when>
    <thetext>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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98412</commentid>
    <comment_count>5</comment_count>
    <who name="steve faulkner">faulkner.steve</who>
    <bug_when>2014-01-14 10:57:52 +0000</bug_when>
    <thetext>(In reply to github bugzilla bot from comment #4)
&gt; Commit pushed to master at https://github.com/w3c/html
&gt; 
&gt; https://github.com/w3c/html/commit/11c025f70bf7364e37cec508592c99916f92c3c8
&gt; added advice about effect of linked labels
&gt; 
&gt; see bug 24279

whoops sorry added to wrong bug</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98446</commentid>
    <comment_count>6</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-01-14 19:10:52 +0000</bug_when>
    <thetext>Please reopen when responding to comment 3, thanks.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>