mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 14:28:49 +00:00
LibWeb: Don't trim whitespace when checking for "module" type on scripts
No major engine allows whitespace in the type when checking for
"module".
This was also reflected in the relevant web platform test, but not in
the spec.
The spec has been changed to match this behaviour: 23c723e3e9
This commit is contained in:
parent
405b282bc3
commit
44b8afdbc4
Notes:
sideshowbarker
2024-07-18 04:30:27 +09:00
Author: https://github.com/Lubrsi
Commit: 44b8afdbc4
Pull-request: https://github.com/SerenityOS/serenity/pull/9872
1 changed files with 2 additions and 2 deletions
|
@ -126,12 +126,12 @@ void HTMLScriptElement::prepare_script()
|
|||
|| (!has_type && !has_language)) {
|
||||
script_block_type = "text/javascript";
|
||||
} else if (has_type) {
|
||||
script_block_type = attribute(HTML::AttributeNames::type).trim_whitespace();
|
||||
script_block_type = attribute(HTML::AttributeNames::type);
|
||||
} else if (!attribute(HTML::AttributeNames::language).is_empty()) {
|
||||
script_block_type = String::formatted("text/{}", attribute(HTML::AttributeNames::language));
|
||||
}
|
||||
|
||||
if (is_javascript_mime_type_essence_match(script_block_type)) {
|
||||
if (is_javascript_mime_type_essence_match(script_block_type.trim_whitespace())) {
|
||||
m_script_type = ScriptType::Classic;
|
||||
} else if (script_block_type.equals_ignoring_case("module")) {
|
||||
m_script_type = ScriptType::Module;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue