<?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>15413</bug_id>
          
          <creation_ts>2012-01-04 03:31:08 +0000</creation_ts>
          <short_desc>&lt;label&gt; :checked state should reflect the input&apos;s one</short_desc>
          <delta_ts>2012-02-02 01:39:19 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>CSS</product>
          <component>Selectors</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Giorgio">giorgio.liscio</reporter>
          <assigned_to name="fantasai">fantasai.bugs</assigned_to>
          <cc>dbaron</cc>
    
    <cc>ian</cc>
    
    <cc>jackalmage</cc>
    
    <cc>jonas</cc>
    
    <cc>mike</cc>
    
    <cc>mtanalin</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
          
          <qa_contact name="This bug has no owner yet - up for the taking">dave.null</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>62261</commentid>
    <comment_count>0</comment_count>
    <who name="Giorgio">giorgio.liscio</who>
    <bug_when>2012-01-04 03:31:08 +0000</bug_when>
    <thetext>hello, I think people expect to see working an expression like this:

&lt;style&gt;
label:checked{background:lime;}
&lt;/style&gt;

&lt;label for=&quot;asd&quot;&gt;Check me&lt;/label&gt;
...
&lt;input type=&quot;checkbox&quot; name=&quot;test&quot; id=&quot;asd&quot;&gt;

hope this helps</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62314</commentid>
    <comment_count>1</comment_count>
    <who name="Marat Tanalin | tanalin.com">mtanalin</who>
    <bug_when>2012-01-05 22:37:21 +0000</bug_when>
    <thetext>Indeed, it would be nice.

Currently we are forced to place LABEL exactly after INPUT and use adjacent-sibling combinator to style LABEL:

	INPUT + LABEL {...}

Someone may say that it&apos;s not about HTML, but about CSS. However, same way as we have input.checked JS property, we could have label.checked JS-property. CSS could then just add corresponding selector to reflect this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62316</commentid>
    <comment_count>2</comment_count>
    <who name="Tab Atkins Jr.">jackalmage</who>
    <bug_when>2012-01-05 23:04:15 +0000</bug_when>
    <thetext>This can be addressed with some new additions in Selectors 4, without any necessary change to HTML.

If you have &lt;label for&gt;, it can be done with a selector like &quot;label! /for/ :checked&quot;.  This uses the reference combinator (&quot;/for/&quot; &lt;http://dev.w3.org/csswg/selectors4/#idref-combinators&gt;) to link the label to its input, and uses the subject indicator (&quot;!&quot; &lt;http://dev.w3.org/csswg/selectors4/#subject&gt;) to indicate you&apos;re trying to select the label, not the input.

If you have a plain &lt;label&gt; that contains its input, you can use &quot;label! :checked&quot;, again using the subject indicator to select the label instead of the input.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>63564</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-02-02 01:39:19 +0000</bug_when>
    <thetext>This is a CSS/selectors issue.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>