<?xml-stylesheet href="../../../style/xml-full.css" type="text/css"?>
<?xml-stylesheet href="css3-modsel-d1b.css" type="text/css"?>
<test xmlns:xlink="http://www.w3.org/1999/xlink">
 <title>Dynamic handling of :empty</title>
 <author>Ian Hickson</author>
 <metadata>
  <item> <name>CSS 3 Module</name> <data>W3C Selectors</data> </item>
  <item> <name>Next</name> <data xlink:type="simple" xlink:href="css3-modsel-d2.xml">Dynamic handling of combinators</data> </item>
  <item> <name>Previous</name> <data xlink:type="simple" xlink:href="css3-modsel-d1.xml">NEGATED Dynamic handling of :empty</data> </item>
  <item> <name>Test #</name> <data>293 of 296</data> </item>
  <item> <name>Testing</name> <data>Dynamic handling of :empty</data> </item>
  <item> <name>ID</name> <data>d1b</data> </item>
  <item> <name>Date</name> <data>2006-03-03</data> </item>
  <item> <name>Revision</name> <data>1.1</data> </item>
 </metadata>
   <requirement>The UA must support ECMA-262 and DOM Level 2 Core for this test.</requirement>
  <content>

 <div xmlns="http://www.w3.org/1999/xhtml">

  <script type="text/javascript">
   <![CDATA[

    function test() {
      document.getElementById('test1').appendChild(document.createTextNode(''));
      document.getElementById('test2').appendChild(document.createTextNode(' '));
    }

    window.setTimeout("test()", 100);
   ]]>
  </script>

  <p> The following two bars should be green. </p>

  <div id="test1"></div>
  <div id="test2"></div>

 </div>

</content>
  <source>
   <css>
   #test1 { background: red; display: block; padding: 1em; margin: 1em; }
   #test1:empty { background: lime; }
   #test2 { background: lime; display: block; padding: 1em; margin: 1em; }
   #test2:empty { background: red; }
</css>
   <xml>

 &lt;div xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;

  &lt;script type=&quot;text/javascript&quot;&gt;
   &lt;![CDATA[

    function test() {
      document.getElementById(&#39;test1&#39;).appendChild(document.createTextNode(&#39;&#39;));
      document.getElementById(&#39;test2&#39;).appendChild(document.createTextNode(&#39; &#39;));
    }

    window.setTimeout(&quot;test()&quot;, 100);
   ]]&gt;
  &lt;/script&gt;

  &lt;p&gt; The following two bars should be green. &lt;/p&gt;

  &lt;div id=&quot;test1&quot;&gt;&lt;/div&gt;
  &lt;div id=&quot;test2&quot;&gt;&lt;/div&gt;

 &lt;/div&gt;

</xml>
  </source>
</test>