LibWeb/CSS: Evaluate media queries in shadow roots

This fixes a rendering issue on https://prodengi.kz/ that someone on
Discord reported. :^)
This commit is contained in:
thislooksfun 2024-10-19 15:35:41 -05:00 committed by Sam Atkins
commit 0b775da7c7
Notes: github-actions[bot] 2024-10-20 06:58:04 +00:00
5 changed files with 43 additions and 13 deletions

View file

@ -0,0 +1,21 @@
<div id="myShadowHost">
<template shadowrootmode="open">
<style>
span { color: red; }
@media (min-width: 0px) {
span { color: lime; }
}
@media (max-width: 0px) {
span { color: blue !important; }
}
</style>
<span></span>
</template>
</div>
<script src="../include.js"></script>
<script>
test(() => {
let span = myShadowHost.shadowRoot.firstElementChild.nextElementSibling;
println(getComputedStyle(span).color);
});
</script>