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.
33 lines
1017 B
HTML
33 lines
1017 B
HTML
<script type="application/json" id="selectors">
|
|
[{
|
|
"selector": ".t1 td:not(:first-child)",
|
|
"match": ["td12", "td13", "td22", "td23", "td32", "td33"]
|
|
},
|
|
{
|
|
"selector": "p > *:not(:first-child)",
|
|
"match": []
|
|
}]
|
|
</script>
|
|
<div id="testDOM">
|
|
<div>
|
|
<table id="t1" class="t1" border="1">
|
|
<tr>
|
|
<td>1.1</td>
|
|
<td id="td12" class="red">green cell</td>
|
|
<td id="td13" class="red">green cell</td>
|
|
</tr>
|
|
<tr>
|
|
<td>2.1</td>
|
|
<td id="td22" class="red">green cell</td>
|
|
<td id="td23" class="red">green cell</td>
|
|
</tr>
|
|
<tr>
|
|
<td>3.1</td>
|
|
<td id="td32" class="red">green cell</td>
|
|
<td id="td33" class="red">green cell</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<p>This paragraph <span id="span">should be</span> unstyled.</p>
|
|
</div>
|