mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb/HTML: Combine duplicate parsing branches
These are combined in the current spec. No behaviour change.
This commit is contained in:
parent
91e73ecde1
commit
6e2f8166f4
Notes:
github-actions[bot]
2025-11-26 08:54:09 +00:00
Author: https://github.com/AtkinsSJ
Commit: 6e2f8166f4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6931
Reviewed-by: https://github.com/gmta ✅
1 changed files with 5 additions and 13 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue