CSS 3 Module | <== Test # ==> | |
---|---|---|
W3C Selectors | 4 of 11 of the dynamic tests category | |
Testing | Date | Revision |
Dynamic handling of attribute selectors (ID #d3) | 20-november-2001 | 1.0 |
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.
@namespace url(); @namespace ns url(); test { background: red; display: block; padding: 1em; } stub ~ [ns|attribute^=start]:not([ns|attribute~=mid])[ns|attribute*=dle][ns|attribute$=end] ~ test [ { background: lime; }
<div> <script> <![CDATA[ function test() { document.getElementsByTagNameNS('', 'test')[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 --> <test xmlns="" xmlns:none="" none:attribute="fake"></test> <!-- middle part of selector matches this once attribute is fixed --> <test xmlns="" xmlns:none="" none:attribute="start mid dle end"></test> <!-- subject of selector --> <test xmlns=""></test> </div>