| <!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> |