summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-color/parsing/color-invalid-lab.html
blob: 36b93c6c5c3aa1a7084668ac184d041007ef48cd (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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Color Level 4: Parsing and serialization of colors using invalid Lab notation</title>
<link rel="help" href="https://drafts.csswg.org/css-color-4/#lab-colors">
<link rel="help" href="https://drafts.csswg.org/css-color-4/#resolving-lab-lch-values">
<link rel="help" href="https://drafts.csswg.org/css-color-4/#resolving-oklab-oklch-values">
<link rel="help" href="https://drafts.csswg.org/css-color-4/#serializing-lab-lch">
<link rel="help" href="https://drafts.csswg.org/css-color-4/#serializing-oklab-oklch">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
</head>
<body>
<script>
for (const colorSpace of [ "lab", "oklab" ]) {
    test_invalid_value("color", `${colorSpace}(0% 0 0 1)`);
    test_invalid_value("color", `${colorSpace}(0% 0 0 10%)`);
    test_invalid_value("color", `${colorSpace}(0% 0 0deg)`);
    test_invalid_value("color", `${colorSpace}(0% 0% 0deg)`);
    test_invalid_value("color", `${colorSpace}(40% 0 0deg)`);
    test_invalid_value("color", `color(${colorSpace} 20% 0 10 / 50%)`);
}

for (const colorSpace of [ "lch", "oklch" ]) {
    test_invalid_value("color", `${colorSpace}(20% 10 10deg 10)`);
    test_invalid_value("color", `${colorSpace}(20% 10 10deg 10 / 0.5)`);
    test_invalid_value("color", `color(${colorSpace} 20% 0 10 / 50%)`);
}
</script>
</body>
</html>