mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-19 16:59:47 +00:00
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:
parent
1aab7b51ea
commit
0b775da7c7
Notes:
github-actions[bot]
2024-10-20 06:58:04 +00:00
Author: https://github.com/thislooksfun
Commit: 0b775da7c7
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1869
Reviewed-by: https://github.com/AtkinsSJ ✅
5 changed files with 43 additions and 13 deletions
21
Tests/LibWeb/Text/input/ShadowDOM/css-media-queries.html
Normal file
21
Tests/LibWeb/Text/input/ShadowDOM/css-media-queries.html
Normal 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>
|
Loading…
Add table
Add a link
Reference in a new issue