blob: 2eac8f1df99c5b6271e35b8f9033dfa2a68f0569 [file] [edit]
<!DOCTYPE html>
<meta charset="utf-8">
<title>Nested @media in @layer with CSS Nesting</title>
<link rel="help" href="https://drafts.csswg.org/css-nesting-1/">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<!-- Regression test for https://github.com/jsdom/jsdom/issues/3997 -->
<style>
@layer x { .a { @media all { @media all { color: red } } } }
</style>
<div id="div" class="a"></div>
<script>
"use strict";
test(() => {
const div = document.getElementById("div");
const styles = window.getComputedStyle(div);
assert_equals(styles.color, "rgb(255, 0, 0)");
}, "Nested @media in @layer with CSS Nesting parses correctly");
</script>