mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:07:34 +00:00
LibWeb: Forward media attribute from link element to loaded style sheet
Otherwise, we will treat the loaded style sheet as if it had media="all" which is not always appropriate.
This commit is contained in:
parent
a6c6c24428
commit
8a43f5a64a
4 changed files with 22 additions and 0 deletions
17
Tests/LibWeb/Text/input/link-element-media-attribute.html
Normal file
17
Tests/LibWeb/Text/input/link-element-media-attribute.html
Normal file
|
@ -0,0 +1,17 @@
|
|||
<style>
|
||||
body {
|
||||
background: green;
|
||||
}
|
||||
</style>
|
||||
<script src="include.js"></script>
|
||||
<script>
|
||||
let link = document.createElement("link");
|
||||
link.setAttribute("rel", "stylesheet");
|
||||
link.setAttribute("href", "body-background-color-red.css");
|
||||
link.setAttribute("media", "print")
|
||||
document.head.appendChild(link)
|
||||
|
||||
window.onload = function() {
|
||||
println("document background: " + getComputedStyle(document.body).backgroundColor)
|
||||
}
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue