mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-19 23:41:53 +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:
parent
437879f849
commit
cdd78be2d3
Notes:
github-actions[bot]
2024-11-01 22:51:58 +00:00
Author: https://github.com/OHermesJunior
Commit: cdd78be2d3
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2046
Reviewed-by: https://github.com/Gingeh
Reviewed-by: https://github.com/tcl3 ✅
3 changed files with 28 additions and 40 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue