Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-conditional/supports-basic.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>Basic @supports rule parsing</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
@supports (text-decoration-style: solid) {
ul.toc a:hover, ul.toc a:focus {
}
}
</style>
<script>
"use strict";
test(() => {
assert_equals(document.styleSheets.length, 1, "Stylesheet should be parsed");
assert_equals(document.styleSheets[0].cssRules.length, 1, "Stylesheet should have one rule");
const rule = document.styleSheets[0].cssRules[0];
assert_equals(rule.constructor.name, "CSSSupportsRule");
assert_equals(rule.conditionText, "(text-decoration-style: solid)");
}, "@supports rule should parse correctly");
</script>