Files
HTMLKit/HTMLKitTests/css-tests/8.html
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

22 lines
717 B
HTML

<script type="application/json" id="selectors">
[{
"selector": "p[lang|=\"en\"]",
"match": ["1"]
},
{
"selector": "address[lang=\"fi\"]",
"match": ["2"]
},
{
"selector": "span[lang|=\"fr\"]",
"match": []
}]
</script>
<div id="testDOM">
<p id="1" lang="en-gb">This paragraph should have green background because its language is &quot;en-gb&quot;</p>
<address id="2" lang="fi">
<span id="3" lang="en-us">This address should also</span>
<span id="4" lang="en-fr">have green background because the language of the inner SPANs id="" is not French.</span>
</address>
</div>