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

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>17680</bug_id>
          
          <creation_ts>2008-03-05 09:21:47 -0800</creation_ts>
          <short_desc>Combination of checked pseudo-class and multiple chained sibling selectors fails in Webkit</short_desc>
          <delta_ts>2022-07-12 13:11:49 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>CSS</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <bug_file_loc>http://bradclicks.com/cssplay/foldingList.html</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>HasReduction, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>12520</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Brad">brkemper</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>allan.jensen</cc>
    
    <cc>ap</cc>
    
    <cc>bdakin</cc>
    
    <cc>bfulgham</cc>
    
    <cc>cobaco</cc>
    
    <cc>mitz</cc>
    
    <cc>rniwa</cc>
    
    <cc>webkit</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>72803</commentid>
    <comment_count>0</comment_count>
    <who name="Brad">brkemper</who>
    <bug_when>2008-03-05 09:21:47 -0800</bug_when>
    <thetext>The &quot;::checked&quot; pseudo-class selector is supposed to assign a rule based on the &quot;checked&quot; status of a checkbox or radio button. But WebKit only checks the initial attribute in the HTML, and does seem to pay attention to changes that the user makes. The pseudo-class is clearly supposed to reflect whatever the current state is, not just the attribute value at load time. But it doesn&apos;t. In the example, you can see the check-mark change on the box when you click on it or click on the label, but the styling does not change in response. Compare this to FireFox or Opera, where the checkbox actually determines the display or not of the nested UL.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72804</commentid>
    <comment_count>1</comment_count>
    <who name="Brad">brkemper</who>
    <bug_when>2008-03-05 09:24:29 -0800</bug_when>
    <thetext>Also see the radio-button equivalent on this page:

http://bradclicks.com/cssplay/tabs.html

... in which the radio buttons have been left visible in order to illustrate what is happening. Clicking on the tabs (actually labels for the radio buttons) should change the display, as it changes the checked status of the radio button.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74177</commentid>
    <comment_count>2</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2008-03-17 15:22:13 -0700</bug_when>
    <thetext>&lt;rdar://problem/5803703&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74898</commentid>
    <comment_count>3</comment_count>
    <who name="Brad">brkemper</who>
    <bug_when>2008-03-23 18:40:19 -0700</bug_when>
    <thetext>It seems that some progress has been made on this. Now the immediate sibling registers the changes to the &quot;checked&quot; status, but its next sibling does not. So this rule works as the box is checked and unchecked:

li input:checked + label:after {
			content: &apos; (click to close)&apos;; 
			color:red;
		}

But these do not:

		input + label + ul { display:none; }
		input:checked + label + ul { display:block; }
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74947</commentid>
    <comment_count>4</comment_count>
    <who name="Robert Blaut">webkit</who>
    <bug_when>2008-03-24 00:32:16 -0700</bug_when>
    <thetext>Brad, the issue you described is another specific case of problem described in bug 12520</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74949</commentid>
    <comment_count>5</comment_count>
      <attachid>20001</attachid>
    <who name="Robert Blaut">webkit</who>
    <bug_when>2008-03-24 00:43:47 -0700</bug_when>
    <thetext>Created attachment 20001
test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76267</commentid>
    <comment_count>6</comment_count>
    <who name="Dave Hyatt">hyatt</who>
    <bug_when>2008-04-03 14:14:28 -0700</bug_when>
    <thetext>Yeah this case fails &quot;on purpose&quot; right now, since I wanted to come up with a performant way of doing it.  Ideas include:

(1) Just re-resolve everything after the first changed sibling.  Could result in bad slowness in pages as a result, but then again, people chaining these selectors are kind of asking  for it. ;)

(2) Waste more memory and hold a maximum sibling chain count in the RenderStyles.  This count would enable you to only re-resolve as many siblings as necessary on a change.  Would be faster but RenderStyles would have to grow (making all pages take up more memory).

I&apos;m inclined to just do (1) and not worry about the performance.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76285</commentid>
    <comment_count>7</comment_count>
    <who name="Brad">brkemper</who>
    <bug_when>2008-04-03 19:40:54 -0700</bug_when>
    <thetext>Choice number 1 would be better than nothing. What are we talking, maybe an extra quarter second or less after the checkbox is clicked, in an example such as that given? I could see how it might be worse if I had an entire complex page re-render into something vastly different based on the checkbox, but in my example the display property is the biggest change. 

I kind of imagined that the extra memory would only have to be set aside when there were actually sibling selectors in play, in rules that combined them with dynamically updated pseudo-classes (hover also comes to mind). Like maybe you would pre-render screen regions based on what would be needed later with such rules. But I don&apos;t really know what I&apos;m talking about when it comes to memory allocation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>505688</commentid>
    <comment_count>8</comment_count>
    <who name="">cobaco</who>
    <bug_when>2011-11-18 04:56:47 -0800</bug_when>
    <thetext>This seems to be at least partially fixed now, at least for my testpage:
http://freemen.be/testtabs1.html 
http://freemen.be/testtabs2.html 

both testpages work fine with both:
- safari 5.1.1 (7534.51.22)
- chrome 13.0.782.220</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>524263</commentid>
    <comment_count>9</comment_count>
      <attachid>119941</attachid>
    <who name="HowCool.com">programming</who>
    <bug_when>2011-12-19 16:16:31 -0800</bug_when>
    <thetext>Created attachment 119941
Test case, similar to Robert&apos;s

Unfixed as of Chrome 16.0.912.63 (stable) for Robert&apos;s and my testcases.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1882467</commentid>
    <comment_count>10</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-07-12 12:38:41 -0700</bug_when>
    <thetext>I am unable to reproduce this issue across all three test cases:

1) From URL Field
2) Test Case (original from Robert)
3) Test Case updated by HowCool.com

I am using Safari 15.5 on macOS 12.4. It behaves and remembers user state and keep &quot;radio&quot; button or state checked-in and updates styling immediately.

I think it was fixed along the way and can now be marked as RESOLVED CONFIGURATION CHANGED. Thanks!</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>20001</attachid>
            <date>2008-03-24 00:43:47 -0700</date>
            <delta_ts>2008-03-24 00:43:47 -0700</delta_ts>
            <desc>test case</desc>
            <filename>test case</filename>
            <type>text/html</type>
            <size>459</size>
            <attacher name="Robert Blaut">webkit</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+CiAgICBkaXYgeyBib3JkZXI6
IDFweCBzb2xpZDsgaGVpZ2h0OiAxZW07IG1hcmdpbi1ib3R0b206MC41ZW19CiAgICAudGVzdCB7
IGJhY2tncm91bmQtY29sb3I6IHdoaXRlOyB9CiAgICAudGVzdCArIGRpdiArIGRpdiArIGRpdiAg
eyBiYWNrZ3JvdW5kLWNvbG9yOiBibHVlOyB9CiAgICAudGVzdDpjaGVja2VkICsgZGl2ICsgZGl2
ICsgZGl2IHsgYmFja2dyb3VuZC1jb2xvcjogbGltZTsgfQo8L3N0eWxlPgo8bGFiZWwgZm9yPSJj
aGVjayI+dGhlIGxhc3QgZGl2IHNob3VsZCBiZSBibHVlIGFuZCBiZWNvbWUgZ3JlZW4gd2hlbiB5
b3UgY2xpY2sgdGhpcyB0ZXh0IG9uY2U8L2xhYmVsPjxpbnB1dCBjbGFzcz0idGVzdCIgaWQ9ImNo
ZWNrIiB0eXBlPSJjaGVja2JveCI+CjxkaXY+PC9kaXY+CjxkaXY+PC9kaXY+CjxkaXY+PC9kaXY+
Cgog
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>119941</attachid>
            <date>2011-12-19 16:16:31 -0800</date>
            <delta_ts>2011-12-19 16:16:31 -0800</delta_ts>
            <desc>Test case, similar to Robert&apos;s</desc>
            <filename>testcase.html</filename>
            <type>text/html</type>
            <size>372</size>
            <attacher name="HowCool.com">programming</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgogICAgPGhlYWQ+CiAgICAgICAgPHN0eWxlIHR5cGU9InRl
eHQvY3NzIj4KICAgICAgICAgICAgaW5wdXQ6bm90KDpjaGVja2VkKSArIGxhYmVsICsgZGl2IHsK
ICAgICAgICAgICAgICAgIGRpc3BsYXk6IG5vbmU7CiAgICAgICAgICAgIH0KICAgICAgICA8L3N0
eWxlPgogICAgPC9oZWFkPgogICAgPGJvZHk+CiAgICAgICAgPGlucHV0IHR5cGU9ImNoZWNrYm94
IiBpZD0iaGlkZSI+CiAgICAgICAgPGxhYmVsIGZvcj0iaGlkZSI+U2hvdyBtb3JlIGNvbnRlbnQ8
L2xhYmVsPgogICAgICAgIDxkaXY+VGhpcyBzaG91bGQgYmVjb21lIHZpc2libGUgaW1tZWRpYXRl
bHkuPC9kaXY+CiAgICA8L2JvZHk+CjwvaHRtbD4K
</data>

          </attachment>
      

    </bug>

</bugzilla>