Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 2 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /css/css-conditional/at-media-matches-001.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>CSSMediaRule.matches</title>
<link rel="author" title="Kiet Ho" href="mailto:kiet.ho@apple.com">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style id="sheet">
@media all { }
@media not all { }
</style>
<script>
test(() => {
assert_true(sheet.sheet.cssRules[0].matches);
}, '"@media all" always matches');
test(() => {
assert_false(sheet.sheet.cssRules[1].matches);
}, '"@media not all" never matches');
</script>