Files
serenity/Tests/LibWeb/Text/input/ShadowDOM/css-media-queries.html
thislooksfun 271f3c9bdd LibWeb/CSS: Evaluate media queries in shadow roots
This fixes a rendering issue on https://prodengi.kz/ that someone on
Discord reported. :^)

(cherry picked from commit 0b775da7c72a85c099f35d8caf2e7b66721a4483)
2024-11-25 08:50:54 -05:00

22 lines
449 B
HTML

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