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.
This commit is contained in:
Vaxry 2025-03-01 20:28:17 +00:00 committed by Andreas Kling
parent 9208a54b0b
commit 040ccc3b42
Notes: github-actions[bot] 2025-08-17 00:36:21 +00:00

View file

@ -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;
}