Files
T
iska 94fed8afa1 Add CSS test fixtures
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.
2015-11-28 21:10:31 +01:00

28 lines
801 B
HTML

<script type="application/json" id="selectors">
[{
"selector": "#t1",
"match": ["t1"]
},
{
"selector": "li#t2",
"match": ["t2"]
},
{
"selector": "li#t3",
"match": ["t3"]
},
{
"selector": "#t4",
"match": []
}]
</script>
<div id="testDOM">
<ul id="1">
<li id="t1">This list item should have a green background. because its ID is &quot;t1&quot;</li>
<li id="t2">This list item should have a green background. because its ID is &quot;t2&quot;</li>
<li id="t3">
<span id="t44">This list item should have a green background. because the inner SPAN does not match &quot;#t4&quot;</span>
</li>
</ul>
</div>