94fed8afa1
Tests are adapted from the official suite: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/static/flat/ Test file format: Each test file is a HTML fragment with: <script> element with id="selectors": contains a JSON array of several selector definitions. Each selector definition has a selector string as input, a "match" array of the expected matched IDs. Some selectors must fail with a parse error, such selectors have an "error" key with the error location in the selector string. <div> element with id="testDOM": contains the DOM fragment which should be used to select the elements for each of the defined selectors.
24 lines
750 B
HTML
24 lines
750 B
HTML
<script type="application/json" id="selectors">
|
|
[{
|
|
"selector": ".t1",
|
|
"match": ["1"]
|
|
},
|
|
{
|
|
"selector": "li.t2",
|
|
"match": ["2", "3"]
|
|
},
|
|
{
|
|
"selector": ".t3",
|
|
"match": []
|
|
}]
|
|
</script>
|
|
<div id="testDOM">
|
|
<ul>
|
|
<li id="1" class="t1">This list item should have green background because its class is "t1"</li>
|
|
<li id="2" class="t2">This list item should have green background because its class is "t2"</li>
|
|
<li id="3" class="t2">
|
|
<span id="4" class="t33">This list item should have green background because the inner SPAN does not match SPAN.t3</span>
|
|
</li>
|
|
</ul>
|
|
</div>
|