<?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>23561</bug_id>
          
          <creation_ts>2013-10-18 08:41:42 +0000</creation_ts>
          <short_desc>more tags should be allowed inside &lt;label&gt;</short_desc>
          <delta_ts>2016-04-26 22:03:23 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>HTML5 spec</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>MOVED</resolution>
          
          
          <bug_file_loc>http://www.w3.org/html/wg/drafts/html/master/forms.html#the-label-element</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Giorgio">giorgio.liscio</reporter>
          <assigned_to name="This bug has no owner yet - up for the taking">dave.null</assigned_to>
          <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>surkov.alexander</cc>
    
    <cc>travil</cc>
    
    <cc>xn--mlform-iua</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>94928</commentid>
    <comment_count>0</comment_count>
    <who name="Giorgio">giorgio.liscio</who>
    <bug_when>2013-10-18 08:41:42 +0000</bug_when>
    <thetext>hello,

i think tags such as &lt;div&gt; or &lt;p&gt; should be allowed inside &lt;label&gt;

i would consider it like &lt;a&gt;, a focusable area that is not necessarily just a span of text

note: browsers didn&apos;t modify the parser yet to follow the spec so the following syntax is in fact still allowed and functioning

&lt;label&gt;
     &lt;div&gt;test&lt;/div&gt;
     &lt;input type=&quot;text&quot;&gt;
&lt;/label&gt;

(tested all msies 6+, firefox, webkit based browsers)

so, spec could be changed to follow the implementations. what do you think?

I don&apos;t have an use case, but i think it&apos;s very common the usage of &lt;div&gt;, for example, inside &lt;label&gt;, especially for form styling</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94929</commentid>
    <comment_count>1</comment_count>
    <who name="alexander surkov">surkov.alexander</who>
    <bug_when>2013-10-18 11:51:02 +0000</bug_when>
    <thetext>people put controls under label to link control and label together (in replace of @for attribute usage), it seems to be a general pattern</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94931</commentid>
    <comment_count>2</comment_count>
    <who name="Leif Halvard Silli">xn--mlform-iua</who>
    <bug_when>2013-10-18 13:40:06 +0000</bug_when>
    <thetext>There is one important detail:

Currently the spec says about &lt;label&gt;:

”Contexts in which this element can be used:
    Where phrasing content is expected.”

But if block content is allowed as children of &lt;label&gt;, there would have to be a prohibition on nesting &lt;p&gt; elements:

Contexts in which this element can be used:
    Where phrasing content is expected,
    EXCEPT that when &lt;label&gt; is a child of &lt;p&gt;, then there
    can be no &lt;p&gt; element children of the &lt;label&gt; element.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94939</commentid>
    <comment_count>3</comment_count>
    <who name="Giorgio">giorgio.liscio</who>
    <bug_when>2013-10-18 17:00:01 +0000</bug_when>
    <thetext>@Leif Halvard Silli

I think it can be considered &quot;transparent content&quot; as spec says about the anchor tag

&gt; Transparent, but there must be no interactive content descendant.

http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#transparent</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94940</commentid>
    <comment_count>4</comment_count>
    <who name="Leif Halvard Silli">xn--mlform-iua</who>
    <bug_when>2013-10-18 17:17:31 +0000</bug_when>
    <thetext>(In reply to Giorgio from comment #3)
&gt; @Leif Halvard Silli
&gt; 
&gt; I think it can be considered &quot;transparent content&quot;

That sounds like the way to go.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126177</commentid>
    <comment_count>5</comment_count>
    <who name="Travis Leithead [MSFT]">travil</who>
    <bug_when>2016-04-26 22:03:23 +0000</bug_when>
    <thetext>HTML5.1 Bugzilla Bug Triage: Moved to Github issue: https://github.com/w3c/html/issues/266

To file additional issues please use the W3C HTML5 Issue tracker: https://github.com/w3c/html/issues/new Thanks!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>