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.
31 lines
959 B
HTML
31 lines
959 B
HTML
<script type="application/json" id="selectors">
|
|
[{
|
|
"selector": "p:not(#other).class:not(.fail).test#id#id",
|
|
"match": ["id"]
|
|
},
|
|
{
|
|
"selector": "div:not(#theid).class:not(.fail).test#theid#theid",
|
|
"match": []
|
|
},
|
|
{
|
|
"selector": "div:not(#other).notclass:not(.fail).test#theid#theid",
|
|
"match": []
|
|
},
|
|
{
|
|
"selector": "div:not(#other).class:not(.test).test#theid#theid",
|
|
"match": []
|
|
},
|
|
{
|
|
"selector": "div:not(#other).class:not(.fail).nottest#theid#theid",
|
|
"match": []
|
|
},
|
|
{
|
|
"selector": "div:not(#other).class:not(.fail).nottest#theid#other",
|
|
"match": []
|
|
}]
|
|
</script>
|
|
<div id="testDOM">
|
|
<p id="id" class="class test">This line should be green.</p>
|
|
<div id="theid" class="class test">This line should be green.</div>
|
|
</div>
|