CSS 3 Module <== Test # ==>
W3C Selectors 295 of 296
Testing Date Revision
Dynamic handling of attribute selectors (ID #d3) 2005-02-24 1.3

NOTE: The UA must support ECMA-262 and DOM Level 2 Core for this test.

NOTE: The UA must support namespaces for this test.

The following block should be green.

   [test] { background: red; display: block; padding: 1em; }
   stub ~ [|attribute^=start]:not([|attribute~=mid])[|attribute*=dle][|attribute$=end] ~ t { background: lime; }

 <div>

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

    function test() {
      document.getElementsByTagNameNS('', 't')[1].setAttributeNS('', 'attribute', 'start middle end');
    }

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

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

  <!-- root of selector -->
  <stub xmlns=""></stub>

  <!-- middle part of selector does not match this -->
  <t xmlns="" attribute="fake"></t>

  <!-- middle part of selector matches this once attribute is fixed -->
  <t xmlns="" attribute="start mid dle end"></t>

  <!-- subject of selector -->
  <t xmlns="" test="test"></t>

 </div>