mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 18:17:22 +02:00
LibWeb: Make javascript mime matching spec compliant
When mime essence matching, the spec only asks for a string comparison ignoring ascii case. The whitespace trimming and parsing of the mime produces unexpected and wrong results. Fixes tests on WPT html/semantics/scripting-1/the-script-element :^)
This commit is contained in:
committed by
Tim Ledbetter
parent
437879f849
commit
cdd78be2d3
Notes:
github-actions[bot]
2024-11-01 22:51:58 +00:00
Author: https://github.com/OHermesJunior Commit: https://github.com/LadybirdBrowser/ladybird/commit/cdd78be2d33 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2046 Reviewed-by: https://github.com/Gingeh Reviewed-by: https://github.com/tcl3 ✅
@@ -217,7 +217,7 @@ void HTMLScriptElement::prepare_script()
|
||||
}
|
||||
|
||||
// 9. If the script block's type string is a JavaScript MIME type essence match,
|
||||
if (MimeSniff::is_javascript_mime_type_essence_match(MUST(script_block_type.trim(Infra::ASCII_WHITESPACE)))) {
|
||||
if (MimeSniff::is_javascript_mime_type_essence_match(script_block_type)) {
|
||||
// then set el's type to "classic".
|
||||
m_script_type = ScriptType::Classic;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user