Skip to content

Commit 501b1cc

Browse files
committed
Add failing CSS cascade layer test
See #3785.
1 parent 1916583 commit 501b1cc

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
css/css-cascade/layers-basic.html: [fail, https://github.com/jsdom/jsdom/issues/3785]
12
css/cssom/style-width-calc-vh-vw.html: [fail, https://github.com/jsdom/jsdom/issues/1332]
23
dom/nodes/Element-closest-null-selectors.html: [fail, https://github.com/jsdom/jsdom/issues/3466]
34
dom/nodes/Element-matches-active-pseudo-class.html: [fail, https://github.com/jsdom/jsdom/issues/3610]
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!DOCTYPE html>
2+
<title>CSS @layers basic example</title>
3+
<meta charset="utf-8">
4+
<script src="/resources/testharness.js"></script>
5+
<script src="/resources/testharnessreport.js"></script>
6+
<link rel="help" href="https://drafts.csswg.org/css-cascade-5/#layering">
7+
<!-- Regression test for https://github.com/jsdom/jsdom/issues/3785 -->
8+
9+
<style>
10+
@layer foo, bar;
11+
@layer foo {
12+
p {
13+
color: yellow;
14+
}
15+
}
16+
17+
@layer bar {
18+
p {
19+
background-color: black;
20+
}
21+
}
22+
23+
p {
24+
font-size: 4rem;
25+
}
26+
</style>
27+
28+
<p id="testP">Test paragraph</p>
29+
30+
<script>
31+
"use strict";
32+
33+
test(() => {
34+
const p = document.getElementById("testP");
35+
const styles = window.getComputedStyle(p);
36+
37+
assert_equals(styles.color, "rgb(255, 255, 0)");
38+
assert_equals(styles.backgroundColor, "rgb(0, 0, 0)");
39+
assert_equals(styles.fontSize, "64px");
40+
});
41+
</script>

0 commit comments

Comments
 (0)