From 040ccc3b42fb392a46c058f13e5c29d2247b1f63 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Sat, 1 Mar 2025 20:28:17 +0000 Subject: [PATCH] LibWeb: Allow loading style sheets without a MIME type Some websites do not specify the MIME type of style sheets, instead using as= or just leaving it empty. Both Chromium and Firefox do load them regardless, so let's do it too. --- Libraries/LibWeb/HTML/HTMLLinkElement.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/LibWeb/HTML/HTMLLinkElement.cpp b/Libraries/LibWeb/HTML/HTMLLinkElement.cpp index a7d9097e47e..3085ff9fbd3 100644 --- a/Libraries/LibWeb/HTML/HTMLLinkElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLLinkElement.cpp @@ -426,7 +426,7 @@ void HTMLLinkElement::process_stylesheet_resource(bool success, Fetch::Infrastru mime_type_string = extracted_mime_type->essence(); } - if (mime_type_string != "text/css"sv) { + if (mime_type_string.has_value() && mime_type_string != "text/css"sv) { success = false; }