<?xml-stylesheet href="../../../style/xml-full.css" type="text/css"?>
<?xml-stylesheet href="css3-modsel-d2.css" type="text/css"?>
<test xmlns:xlink="http://www.w3.org/1999/xlink">
 <title>Dynamic handling of combinators</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-d3.xml">Dynamic handling of attribute selectors</data> </item>
  <item> <name>Previous</name> <data xlink:type="simple" xlink:href="css3-modsel-d1b.xml">Dynamic handling of :empty</data> </item>
  <item> <name>Test #</name> <data>3 of 5 of the dynamic tests category</data> </item>
  <item> <name>Testing</name> <data>Dynamic handling of combinators</data> </item>
  <item> <name>ID</name> <data>d2</data> </item>
  <item> <name>Date</name> <data>2004-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() {
      el = document.getElementById('test');
      el.parentNode.parentNode.insertBefore(document.createElementNS('http://www.w3.org/1999/xhtml', 'div'), el.parentNode);
    }

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

  

  <p> The following bar should be green. </p>

  <div id="stub"></div>
  <div></div>
  <div><div><!-- <div/> --><div><div id="test"></div></div></div></div>

 </div>

</content>
  <source>
   <css>
   #test { background: red; display: block; padding: 1em; }
   #stub ~ div div + div &gt; div { background: lime; }
</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() {
      el = document.getElementById(&#39;test&#39;);
      el.parentNode.parentNode.insertBefore(document.createElementNS(&#39;http://www.w3.org/1999/xhtml&#39;, &#39;div&#39;), el.parentNode);
    }

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

  

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

  &lt;div id=&quot;stub&quot;&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;div&gt;&lt;!-- &lt;div/&gt; --&gt;&lt;div&gt;&lt;div id=&quot;test&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

 &lt;/div&gt;

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