mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 18:17:22 +02:00
LibWeb: Allow hr elements in select and optgroup elements
This commit is contained in:
committed by
Andreas Kling
parent
b8219e2cc4
commit
b439431488
Notes:
sideshowbarker
2024-07-17 03:18:29 +09:00
Author: https://github.com/bplaat Commit: https://github.com/SerenityOS/serenity/commit/b439431488 Pull-request: https://github.com/SerenityOS/serenity/pull/22187
@@ -3411,6 +3411,24 @@ void HTMLParser::handle_in_select(HTMLToken& token)
|
||||
return;
|
||||
}
|
||||
|
||||
// -> A start tag whose tag name is "hr"
|
||||
if (token.is_start_tag() && token.tag_name() == HTML::TagNames::hr) {
|
||||
// If the current node is an option element, pop that node from the stack of open elements.
|
||||
if (current_node().local_name() == HTML::TagNames::option) {
|
||||
(void)m_stack_of_open_elements.pop();
|
||||
}
|
||||
// If the current node is an optgroup element, pop that node from the stack of open elements.
|
||||
if (current_node().local_name() == HTML::TagNames::optgroup) {
|
||||
(void)m_stack_of_open_elements.pop();
|
||||
}
|
||||
// Insert an HTML element for the token. Immediately pop the current node off the stack of open elements.
|
||||
(void)insert_html_element(token);
|
||||
(void)m_stack_of_open_elements.pop();
|
||||
// Acknowledge the token's self-closing flag, if it is set.
|
||||
token.acknowledge_self_closing_flag_if_set();
|
||||
return;
|
||||
}
|
||||
|
||||
if (token.is_end_tag() && token.tag_name() == HTML::TagNames::optgroup) {
|
||||
if (current_node().local_name() == HTML::TagNames::option && node_before_current_node().local_name() == HTML::TagNames::optgroup)
|
||||
(void)m_stack_of_open_elements.pop();
|
||||
|
||||
Reference in New Issue
Block a user