CSS 3 Module | <== Test # ==> | |
---|---|---|
W3C Selectors | 4 of 11 of the dynamic tests category | |
Testing | Date | Revision |
Dynamic handling of attribute selectors (ID #d3) | 2004-05-29 | 1.2 |
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('', '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 --> <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>