mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:48:12 +00:00
LibWeb: Parse "td" start tags during "in cell" insertion mode
This commit is contained in:
parent
49f3323fa8
commit
7aa7a2078f
2 changed files with 21 additions and 1 deletions
|
@ -907,6 +907,19 @@ void HTMLDocumentParser::handle_in_row(HTMLToken& token)
|
||||||
TODO();
|
TODO();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HTMLDocumentParser::close_the_cell()
|
||||||
|
{
|
||||||
|
generate_implied_end_tags();
|
||||||
|
if (!current_node().tag_name().is_one_of("td", "th")) {
|
||||||
|
PARSE_ERROR();
|
||||||
|
}
|
||||||
|
while (!current_node().tag_name().is_one_of("td", "th"))
|
||||||
|
m_stack_of_open_elements.pop();
|
||||||
|
m_stack_of_open_elements.pop();
|
||||||
|
m_list_of_active_formatting_elements.clear_up_to_the_last_marker();
|
||||||
|
m_insertion_mode = InsertionMode::InRow;
|
||||||
|
}
|
||||||
|
|
||||||
void HTMLDocumentParser::handle_in_cell(HTMLToken& token)
|
void HTMLDocumentParser::handle_in_cell(HTMLToken& token)
|
||||||
{
|
{
|
||||||
if (token.is_end_tag() && token.tag_name().is_one_of("td", "th")) {
|
if (token.is_end_tag() && token.tag_name().is_one_of("td", "th")) {
|
||||||
|
@ -930,7 +943,13 @@ void HTMLDocumentParser::handle_in_cell(HTMLToken& token)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (token.is_start_tag() && token.tag_name().is_one_of("caption", "col", "colgroup", "tbody", "td", "tfoot", "th", "thead", "tr")) {
|
if (token.is_start_tag() && token.tag_name().is_one_of("caption", "col", "colgroup", "tbody", "td", "tfoot", "th", "thead", "tr")) {
|
||||||
TODO();
|
if (!m_stack_of_open_elements.has_in_table_scope("td") && m_stack_of_open_elements.has_in_table_scope("th")) {
|
||||||
|
PARSE_ERROR();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
close_the_cell();
|
||||||
|
process_using_the_rules_for(m_insertion_mode, token);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (token.is_end_tag() && token.tag_name().is_one_of("body", "caption", "col", "colgroup", "html")) {
|
if (token.is_end_tag() && token.tag_name().is_one_of("body", "caption", "col", "colgroup", "html")) {
|
||||||
|
|
|
@ -114,6 +114,7 @@ private:
|
||||||
void clear_the_stack_back_to_a_table_context();
|
void clear_the_stack_back_to_a_table_context();
|
||||||
void clear_the_stack_back_to_a_table_body_context();
|
void clear_the_stack_back_to_a_table_body_context();
|
||||||
void clear_the_stack_back_to_a_table_row_context();
|
void clear_the_stack_back_to_a_table_row_context();
|
||||||
|
void close_the_cell();
|
||||||
|
|
||||||
InsertionMode m_insertion_mode { InsertionMode::Initial };
|
InsertionMode m_insertion_mode { InsertionMode::Initial };
|
||||||
InsertionMode m_original_insertion_mode { InsertionMode::Initial };
|
InsertionMode m_original_insertion_mode { InsertionMode::Initial };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue