From 02497888a616f297b394a5e0120a1b9792985f63 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 20 Mar 2022 17:20:59 +0100 Subject: [PATCH] LibWeb: Ignore linked stylesheets with MIME types other than text/css This makes the "Acid3" text on ACID3 not show up in red. :^) --- Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp index 3d2c688786..8c978193fc 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp @@ -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());