diff options
author | Kyle McLean <kylem590@gmail.com> | 2020-06-03 22:34:50 -0600 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-06-04 09:09:33 +0200 |
commit | 1ad81e483356c56e3341ded02ecbe3baefeba049 (patch) | |
tree | 692ac0ca8d30fe363802ef0715b4316d98576ef8 | |
parent | 9fca4b56d30048fb4560497a90665291eedbaae7 (diff) | |
download | serenity-1ad81e483356c56e3341ded02ecbe3baefeba049.zip |
LibWeb: Parse "br" end tags during "in body"
-rw-r--r-- | Libraries/LibWeb/Parser/HTMLDocumentParser.cpp | 4 | ||||
-rw-r--r-- | Libraries/LibWeb/Parser/HTMLToken.h | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp b/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp index 146e848d29..bfb39f9d56 100644 --- a/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp +++ b/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp @@ -1195,10 +1195,12 @@ void HTMLDocumentParser::handle_in_body(HTMLToken& token) } if (token.is_end_tag() && token.tag_name() == "br") { - TODO(); + token.drop_attributes(); + goto BRStartTag; } if (token.is_start_tag() && token.tag_name().is_one_of("area", "br", "embed", "img", "keygen", "wbr")) { + BRStartTag: reconstruct_the_active_formatting_elements(); insert_html_element(token); m_stack_of_open_elements.pop(); diff --git a/Libraries/LibWeb/Parser/HTMLToken.h b/Libraries/LibWeb/Parser/HTMLToken.h index 6ef33d5baf..17979eedc9 100644 --- a/Libraries/LibWeb/Parser/HTMLToken.h +++ b/Libraries/LibWeb/Parser/HTMLToken.h @@ -123,6 +123,12 @@ public: return {}; } + void drop_attributes() + { + ASSERT(is_start_tag() || is_end_tag()); + m_tag.attributes.clear(); + } + Type type() const { return m_type; } String to_string() const; |