summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/mediaqueries/mq-invalid-media-type-layer-002.html
blob: 3f8b719bfab8eb29483ff94c271b30eced5abece (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<title>Mediaqueries-3 test: parsing hanging-punctuation with invalid values</title>
<link rel="help" href="https://www.w3.org/TR/css3-mediaqueries/#error-handling">
<link rel="author" title="Florian Rivoal" href="https://florian.rivoal.net/">
<meta name="flags" content="invalid">
<meta name="assert" content="'layer' must not be treated as an unknown media type, but rather trigger the malformed query clause.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
    @media not layer {
        body { background-color: red; }
    }
    @media layer {
        body { background-color: red; }
    }
</style>
<script>
var queries = document.styleSheets[0].cssRules;
test(() => {
        for (const query of queries) {
                assert_equals(query.conditionText, "not all");
        }
        assert_equals(queries.length, 2, "invalid rules must be treated as 'not all', not dropped");
    }, "'layer' used as media types is a syntax error");
</script>