<?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>11384</bug_id>
          
          <creation_ts>2006-10-23 02:43:41 -0700</creation_ts>
          <short_desc>CSS2/3: Selectors are not re-evaluated after dynamically updating the DOM (Acid3 bug)</short_desc>
          <delta_ts>2008-02-21 22:19:21 -0800</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>420+</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.css3.info/selectors-test/</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>HasReduction</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>17143</dependson>
          <blocked>11390</blocked>
    
    <blocked>17064</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Niels Leenheer (HTML5test)">info</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>allan.jensen</cc>
    
    <cc>bdakin</cc>
    
    <cc>eric</cc>
    
    <cc>michiel</cc>
    
    <cc>mrowe</cc>
    
    <cc>webkit</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>51194</commentid>
    <comment_count>0</comment_count>
    <who name="Niels Leenheer (HTML5test)">info</who>
    <bug_when>2006-10-23 02:43:41 -0700</bug_when>
    <thetext>After the DOM is modified the CSS selectors should be re-evaluated. 
Affected selectors: :first-child, :last-child, :only-child, :first-of-type, :last-of-type, :only-of-type, :empty

For example: an element that used to be empty would match the :empty selector. If the update added a new child to that element, it should no longer match  the :empty selector. 

Another example: an element that is the only child of its parent would match the following selectors: :first-child, :last-child, :only-child, :first-of-type, :last-of-type and :only-of-type. If we modify the DOM and append another child of the same type, the original element would only match the :first-child selector.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36587</commentid>
    <comment_count>1</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2007-01-07 02:50:10 -0800</bug_when>
    <thetext>I believe there an existing bug which may already cover this issue, but I can&apos;t find it in my quick skim through Bugzilla.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68549</commentid>
    <comment_count>2</comment_count>
      <attachid>18758</attachid>
    <who name="Robert Blaut">webkit</who>
    <bug_when>2008-01-29 00:32:11 -0800</bug_when>
    <thetext>Created attachment 18758
Minimal test case

I&apos;ve created minimal test case for this bug based on CSS3 Selectors test suite.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68555</commentid>
    <comment_count>3</comment_count>
    <who name="Robert Blaut">webkit</who>
    <bug_when>2008-01-29 00:54:36 -0800</bug_when>
    <thetext>(In reply to comment #1)
&gt; I believe there an existing bug which may already cover this issue, but I can&apos;t
&gt; find it in my quick skim through Bugzilla.

After searching I&apos;ve found three reports similar to this bug: bug 12519, bug 12520, bug 16706. 

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68571</commentid>
    <comment_count>4</comment_count>
    <who name="Robert Blaut">webkit</who>
    <bug_when>2008-01-29 04:42:37 -0800</bug_when>
    <thetext>*** Bug 16706 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68846</commentid>
    <comment_count>5</comment_count>
    <who name="Robert Blaut">webkit</who>
    <bug_when>2008-01-30 14:37:36 -0800</bug_when>
    <thetext>Found another similar bug 9983.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68851</commentid>
    <comment_count>6</comment_count>
    <who name="Robert Blaut">webkit</who>
    <bug_when>2008-01-30 15:06:19 -0800</bug_when>
    <thetext>Interesting behavior regarding test case found by Alexey:

1. Open the test case in a new tab in background.
2. Don&apos;t activate the background tab unless it loads completely.
3. Switch to the background tab and you see the test case passed.

IMO this behavior is caused by the fact that styles are applied when the page becomes visible (not earlier). So the styles are applied on modified DOM tree. The styles don&apos;t need to be re-evaluated.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69166</commentid>
    <comment_count>7</comment_count>
    <who name="Dave Hyatt">hyatt</who>
    <bug_when>2008-02-02 02:49:13 -0800</bug_when>
    <thetext>This has been taken care of.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71466</commentid>
    <comment_count>8</comment_count>
    <who name="Robert Blaut">webkit</who>
    <bug_when>2008-02-21 22:19:21 -0800</bug_when>
    <thetext>*** Bug 9983 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>18758</attachid>
            <date>2008-01-29 00:32:11 -0800</date>
            <delta_ts>2008-01-29 00:32:11 -0800</delta_ts>
            <desc>Minimal test case</desc>
            <filename>test-case1.html</filename>
            <type>text/html</type>
            <size>531</size>
            <attacher name="Robert Blaut">webkit</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMDEvL0VOIiAiaHR0cDov
L3d3dy53My5vcmcvVFIvaHRtbDQvc3RyaWN0LmR0ZCI+CjxodG1sPgo8aGVhZD4KPHRpdGxlPlRl
c3QgY2FzZSBmb3IgcmUtZXZhbHVhdGluZyBzZWxlY3RvcnMgYWZ0ZXIgZHluYW1pY2FsbHkgdXBk
YXRpbmcgdGhlIERPTTwvdGl0bGU+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+CgkjdGVzdDpmaXJz
dC1jaGlsZCB7YmFja2dyb3VuZC1jb2xvcjogcmVkO30KPC9zdHlsZT4KPC9oZWFkPgoJCQkJCjxk
aXY+Cgk8ZGl2IGlkPSJ0ZXN0Ij5UaGlzIHRleHQgU0hPVUxEIE5PVCBoYXZlIFJFRCBiYWNrZ3Jv
dW5kPC9kaXY+CjwvZGl2PgoKPHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFzY3JpcHQiPgoJdmFyIHRl
c3QgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgndGVzdCcpOwoJdGVzdC5wYXJlbnROb2RlLmlu
c2VydEJlZm9yZShkb2N1bWVudC5jcmVhdGVFbGVtZW50KCJkaXYiKSwgdGVzdCk7Cjwvc2NyaXB0
PgoKPC9ib2R5Pgo8L2h0bWw+
</data>

          </attachment>
      

    </bug>

</bugzilla>