1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:38:12 +00:00
serenity/Tests/LibWeb/Text/input/link-element-media-attribute.html
Andreas Kling 8a43f5a64a 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.
2023-06-11 06:05:03 +02:00

17 lines
465 B
HTML

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