mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02:00
LibWeb/HTML: Combine duplicate parsing branches
These are combined in the current spec. No behaviour change.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
91e73ecde1
commit
6e2f8166f4
Notes:
github-actions[bot]
2025-11-26 08:54:09 +00:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/LadybirdBrowser/ladybird/commit/6e2f8166f48 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6931 Reviewed-by: https://github.com/gmta ✅
@@ -2095,14 +2095,9 @@ void HTMLParser::handle_in_body(HTMLToken& token)
|
||||
}
|
||||
|
||||
// -> A start tag whose tag name is one of: "base", "basefont", "bgsound", "link", "meta", "noframes", "script", "style", "template", "title"
|
||||
if (token.is_start_tag() && token.tag_name().is_one_of(HTML::TagNames::base, HTML::TagNames::basefont, HTML::TagNames::bgsound, HTML::TagNames::link, HTML::TagNames::meta, HTML::TagNames::noframes, HTML::TagNames::script, HTML::TagNames::style, HTML::TagNames::template_, HTML::TagNames::title)) {
|
||||
// Process the token using the rules for the "in head" insertion mode.
|
||||
process_using_the_rules_for(InsertionMode::InHead, token);
|
||||
return;
|
||||
}
|
||||
|
||||
// -> An end tag whose tag name is "template"
|
||||
if (token.is_end_tag() && token.tag_name() == HTML::TagNames::template_) {
|
||||
if ((token.is_start_tag() && token.tag_name().is_one_of(HTML::TagNames::base, HTML::TagNames::basefont, HTML::TagNames::bgsound, HTML::TagNames::link, HTML::TagNames::meta, HTML::TagNames::noframes, HTML::TagNames::script, HTML::TagNames::style, HTML::TagNames::template_, HTML::TagNames::title))
|
||||
|| (token.is_end_tag() && token.tag_name() == HTML::TagNames::template_)) {
|
||||
// Process the token using the rules for the "in head" insertion mode.
|
||||
process_using_the_rules_for(InsertionMode::InHead, token);
|
||||
return;
|
||||
@@ -4373,13 +4368,10 @@ void HTMLParser::handle_in_template(HTMLToken& token)
|
||||
}
|
||||
|
||||
// -> A start tag whose tag name is one of: "base", "basefont", "bgsound", "link", "meta", "noframes", "script", "style", "template", "title"
|
||||
if (token.is_start_tag() && token.tag_name().is_one_of(HTML::TagNames::base, HTML::TagNames::basefont, HTML::TagNames::bgsound, HTML::TagNames::link, HTML::TagNames::meta, HTML::TagNames::noframes, HTML::TagNames::script, HTML::TagNames::style, HTML::TagNames::template_, HTML::TagNames::title)) {
|
||||
process_using_the_rules_for(InsertionMode::InHead, token);
|
||||
return;
|
||||
}
|
||||
|
||||
// -> An end tag whose tag name is "template"
|
||||
if (token.is_end_tag() && token.tag_name() == HTML::TagNames::template_) {
|
||||
if ((token.is_start_tag() && token.tag_name().is_one_of(HTML::TagNames::base, HTML::TagNames::basefont, HTML::TagNames::bgsound, HTML::TagNames::link, HTML::TagNames::meta, HTML::TagNames::noframes, HTML::TagNames::script, HTML::TagNames::style, HTML::TagNames::template_, HTML::TagNames::title))
|
||||
|| (token.is_end_tag() && token.tag_name() == HTML::TagNames::template_)) {
|
||||
// Process the token using the rules for the "in head" insertion mode.
|
||||
process_using_the_rules_for(InsertionMode::InHead, token);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user