mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 11:20:03 +00: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
@@ -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