Skip to content

Commit cf5523f

Browse files
authored
Add more test cases for nested color-mix with currentColor
Related to work in #4085 and #4119.
1 parent b33b616 commit cf5523f

2 files changed

Lines changed: 45 additions & 0 deletions

File tree

test/web-platform-tests/to-upstream-expectations.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ css/css-borders/border-color.html: [fail, https://github.com/jsdom/jsdom/issues/
22
css/css-borders/border-shorthands.html:
33
"Computed value of border shorthand": [fail, Regression test for https://github.com/jsdom/jsdom/issues/3971]
44
css/css-cascade/layers-basic.html: [fail, https://github.com/jsdom/jsdom/issues/3785]
5+
css/css-color/nested-color-mix-with-currentcolor.html:
6+
"Nested color-mix function with inner currentColor should inherit unresolved; part2": [fail, Need getComputedStyle() fix]
57
css/css-conditional/container-queries-basic.html: [fail, https://github.com/jsdom/jsdom/issues/3597]
68
css/css-display/display-initial.html:
79
"Revert value of display": [fail, Revert keyword is not supported]
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<!doctype html>
2+
<title>CSS Color: Nested color-mix() with currentColor</title>
3+
<link rel="help" href="https://www.w3.org/TR/css-color-5/#color-mix">
4+
<link rel="help" href="https://www.w3.org/TR/css-color-5/#resolving-color-values">
5+
<script src="/resources/testharness.js"></script>
6+
<script src="/resources/testharnessreport.js"></script>
7+
<style>
8+
#parent {
9+
color: red;
10+
background-color: color-mix(in lch, color-mix(in lch, black, currentColor), black);
11+
}
12+
#parent2 {
13+
color: red;
14+
background-color: color-mix(in srgb, color-mix(in srgb, black, currentColor), black);
15+
}
16+
#child {
17+
color: black;
18+
background-color: inherit;
19+
}
20+
#child2 {
21+
color: white;
22+
background-color: inherit;
23+
}
24+
</style>
25+
<div id="parent">
26+
<div id="child"></div>
27+
</div>
28+
<div id="parent2">
29+
<div id="child2"></div>
30+
</div>
31+
<script>
32+
"use strict";
33+
const child = document.getElementById("child");
34+
const child2 = document.getElementById("child2");
35+
36+
test(() => {
37+
assert_equals(getComputedStyle(child).backgroundColor, "lch(0 0 none)");
38+
}, "Nested color-mix function with inner currentColor should inherit unresolved");
39+
40+
test(() => {
41+
assert_equals(getComputedStyle(child2).backgroundColor, "color(srgb 0.25 0.25 0.25)");
42+
}, "Nested color-mix function with inner currentColor should inherit unresolved; part2");
43+
</script>

0 commit comments

Comments
 (0)