summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-contain/container-queries/container-name-parsing.html
blob: 4f385cca5245cd63e531d1ddf26c84cf31b7b2a6 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!doctype html>
<meta charset="utf-8">
<title>CSS Containment Test: Parsing of container-name</title>
<link rel="help" href="https://drafts.csswg.org/css-contain-3/#container-name">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
<script src="support/cq-testcommon.js"></script>
<div id="target"></div>
<script>
setup(() => assert_implements_container_queries());

test_valid_value('container-name', 'initial');
test_valid_value('container-name', 'inherit');
test_valid_value('container-name', 'unset');
test_valid_value('container-name', 'revert');
test_valid_value('container-name', 'none');
test_valid_value('container-name', 'foo');
test_valid_value('container-name', 'BAR');
test_valid_value('container-name', 'foo bar');
test_valid_value('container-name', 'foo foo');
test_valid_value('container-name', '\\!escaped');
test_valid_value('container-name', 'auto');
test_valid_value('container-name', 'normal');

test_invalid_value('container-name', 'none none');
test_invalid_value('container-name', 'foo, bar');
test_invalid_value('container-name', '#fff');
test_invalid_value('container-name', '1px');
test_invalid_value('container-name', 'default'); /* reserved */

test_invalid_value('container-name', '"initial"');
test_invalid_value('container-name', '"inherit"');
test_invalid_value('container-name', '"unset"');
test_invalid_value('container-name', '"revert"');
test_invalid_value('container-name', '"none"');
test_invalid_value('container-name', '"foo"');

test_invalid_value('container-name', 'not');
test_invalid_value('container-name', 'and');
test_invalid_value('container-name', 'or');
test_invalid_value('container-name', 'Not');
test_invalid_value('container-name', 'aNd');
test_invalid_value('container-name', 'oR');
</script>