1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:57:43 +00:00

LibWeb: Ignore linked stylesheets with MIME types other than text/css

This makes the "Acid3" text on ACID3 not show up in red. :^)
This commit is contained in:
Andreas Kling 2022-03-20 17:20:59 +01:00
parent 2b7775118d
commit 02497888a6

View file

@ -90,6 +90,11 @@ void HTMLLinkElement::resource_did_load()
dbgln_if(CSS_LOADER_DEBUG, "HTMLLinkElement: Resource did load, no encoded data. URL: {}", resource()->url());
} else {
dbgln_if(CSS_LOADER_DEBUG, "HTMLLinkElement: Resource did load, has encoded data. URL: {}", resource()->url());
if (resource()->mime_type() != "text/css"sv) {
dbgln_if(CSS_LOADER_DEBUG, "HTMLLinkElement: Resource did load, but MIME type was {} instead of text/css. URL: {}", resource()->mime_type(), resource()->url());
return;
}
}
auto sheet = parse_css(CSS::ParsingContext(document(), resource()->url()), resource()->encoded_data());