<?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>27293</bug_id>
          
          <creation_ts>2014-11-10 15:42:01 +0000</creation_ts>
          <short_desc>&lt;label&gt; element content model</short_desc>
          <delta_ts>2015-09-04 12:45:56 +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>WORKSFORME</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>27292</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Simon Pieters">zcorpan</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>ian</cc>
    
    <cc>master.skywalker.88</cc>
    
    <cc>mike</cc>
    
    <cc>mtanalin</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>zcorpan</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>114748</commentid>
    <comment_count>0</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2014-11-10 15:42:01 +0000</bug_when>
    <thetext>+++ This bug was initially created as a clone of Bug #27292 +++

The label element has some restrictions in the fact that it can contain no form controls but its labeled control, and it can&apos;t contain other label elements.
However, one more restriction should apply: it shouldn&apos;t be allowed to contain any &lt;a&gt; element with a @href attribute, because on some user agents (I tested it on Chrome, latest version as of now) clicking on link prevents the control state change behavior, even if the link points to a different browsing context (e.g. iframe, popup, new tab).
Or probably it shouldn&apos;t contain any interactive element, for the same reason: conflict arises between events.

http://www.w3.org/TR/html5/forms.html#the-label-element</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>114750</commentid>
    <comment_count>1</comment_count>
    <who name="Marat Tanalin | tanalin.com">mtanalin</who>
    <bug_when>2014-11-10 16:04:31 +0000</bug_when>
    <thetext>See bug 27292 comment 1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>114852</commentid>
    <comment_count>2</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-11-12 19:07:11 +0000</bug_when>
    <thetext>This is definitely intentional as written. I believe Chrome is buggy here — the way label is specced is supposed to make this work out ok.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>114870</commentid>
    <comment_count>3</comment_count>
    <who name="Andrea Rendine">master.skywalker.88</who>
    <bug_when>2014-11-12 20:49:53 +0000</bug_when>
    <thetext>How so? Does this mean that a link (&lt;a&gt; element) inside a &lt;label&gt; should both navigate the link and change the control state?
Then I&apos;m afraid that Chrome, IE, Firefox, Opera and Android are all buggy. A link inside a label always brings to navigating the link itself, while the control state doesn&apos;t change. Which doesn&apos;t mean that the control itself is ignored. Where the control has an active state which is visually evident, it changes color as far as the &lt;label&gt; is active (i.e. the mouse button is pressed). But the final state is not changed.
This applies to internal anchor links and link to different browsing contexts as well, both in nested controls and in those referred to via @for.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>114875</commentid>
    <comment_count>4</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-11-12 23:03:48 +0000</bug_when>
    <thetext>Clicking a link in a label is supposed to just follow the link and not touch the label&apos;s control. I understood comment 0 as saying that Chrome didn&apos;t do this, but it looks like I misread it.

If we&apos;re all agreed that the spec and all the implementations match, then I&apos;m confused as to what the bug is.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>117169</commentid>
    <comment_count>5</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2015-01-14 21:55:12 +0000</bug_when>
    <thetext>The style changing is a result of the weird legacy :active behaviour. I tried not having that but had to change the spec to match implementations because apparently sites depend on it.

I think this is WORKSFORME.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>122881</commentid>
    <comment_count>6</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2015-08-28 17:48:52 +0000</bug_when>
    <thetext>Simon, this seems to be waiting on you to say resolve or not, based on your response to https://www.w3.org/Bugs/Public/show_bug.cgi?id=27293#c5</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123079</commentid>
    <comment_count>7</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2015-09-04 12:45:56 +0000</bug_when>
    <thetext>The clonee bug has some examples that might not work so well, but it&apos;s pretty common to have something like

&lt;label&gt;&lt;input type=checkbox ...&gt; I have read and agree to &lt;a href&gt;terms of service&lt;/a&gt;&lt;/label&gt;

which, apart from confusing :active style applying on the checkbox when clicking the link, works as intended AFAICT.

If you want :active changed, please file a new issue at https://github.com/whatwg/html/issues</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>