mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-06 11:12:54 +00:00
LibWeb: Parse "form" tags during the "in body" insertion mode
This commit is contained in:
parent
851a0f983a
commit
fbd52047bb
Notes:
sideshowbarker
2024-07-19 05:57:41 +09:00
Author: https://github.com/awesomekling
Commit: fbd52047bb
3 changed files with 36 additions and 2 deletions
|
@ -817,7 +817,16 @@ void HTMLDocumentParser::handle_in_body(HTMLToken& token)
|
|||
}
|
||||
|
||||
if (token.is_start_tag() && token.tag_name() == "form") {
|
||||
TODO();
|
||||
if (m_form_element && m_stack_of_open_elements.contains("template")) {
|
||||
PARSE_ERROR();
|
||||
return;
|
||||
}
|
||||
if (m_stack_of_open_elements.has_in_button_scope("p"))
|
||||
close_a_p_element();
|
||||
auto element = insert_html_element(token);
|
||||
if (!m_stack_of_open_elements.contains("template"))
|
||||
m_form_element = to<HTMLFormElement>(*element);
|
||||
return;
|
||||
}
|
||||
|
||||
if (token.is_start_tag() && token.tag_name() == "li") {
|
||||
|
@ -887,7 +896,22 @@ void HTMLDocumentParser::handle_in_body(HTMLToken& token)
|
|||
}
|
||||
|
||||
if (token.is_end_tag() && token.tag_name() == "form") {
|
||||
TODO();
|
||||
if (!m_stack_of_open_elements.contains("template")) {
|
||||
auto node = m_form_element;
|
||||
m_form_element = nullptr;
|
||||
if (!node || m_stack_of_open_elements.has_in_scope(*node)) {
|
||||
PARSE_ERROR();
|
||||
return;
|
||||
}
|
||||
generate_implied_end_tags();
|
||||
if (¤t_node() != node) {
|
||||
PARSE_ERROR();
|
||||
}
|
||||
m_stack_of_open_elements.elements().remove_first_matching([&](auto& entry) { return entry.ptr() == node.ptr(); });
|
||||
} else {
|
||||
TODO();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (token.is_end_tag() && token.tag_name() == "p") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue