LibWeb: Allow loading style sheets without a MIME type
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run

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
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(); 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; success = false;
} }