1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:58:11 +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:
Andreas Kling 2023-06-10 19:53:36 +02:00
parent a6c6c24428
commit 8a43f5a64a
4 changed files with 22 additions and 0 deletions

View file

@ -364,6 +364,7 @@ void HTMLLinkElement::process_stylesheet_resource(bool success, Fetch::Infrastru
if (m_loaded_style_sheet) {
m_loaded_style_sheet->set_owner_node(this);
m_loaded_style_sheet->set_media(attribute(HTML::AttributeNames::media));
document().style_sheets().add_sheet(*m_loaded_style_sheet);
} else {
dbgln_if(CSS_LOADER_DEBUG, "HTMLLinkElement: Failed to parse stylesheet: {}", resource()->url());