diff options
author | Andreas Kling <kling@serenityos.org> | 2020-05-25 20:02:27 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-05-25 20:02:27 +0200 |
commit | 50265858abfc562297c62645e1ca96f16c46aad1 (patch) | |
tree | 818a4ee28b4cb6f08a398bde4a22cbd4e5aa0948 | |
parent | 406fd95f327bd196e3781f8b1a21cfdcee684c2b (diff) | |
download | serenity-50265858abfc562297c62645e1ca96f16c46aad1.zip |
LibWeb: Add a PARSE_ERROR() macro to the new HTML parser
Unless otherwise stated, we shouldn't stop parsing just because there's
a parse error, so let's allow ourselves to continue.
With this change, we can now tokenize and parse the ACID1 test. :^)
-rw-r--r-- | Libraries/LibWeb/Parser/HTMLDocumentParser.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp b/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp index ac66a6889c..91c2910db3 100644 --- a/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp +++ b/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp @@ -41,6 +41,11 @@ ASSERT_NOT_REACHED(); \ } while (0) +#define PARSE_ERROR() \ + do { \ + dbg() << "Parse error!"; \ + } while (0) + namespace Web { HTMLDocumentParser::HTMLDocumentParser(const StringView& input) @@ -353,8 +358,7 @@ void HTMLDocumentParser::close_a_p_element() { generate_implied_end_tags("p"); if (current_node().tag_name() != "p") { - // Parse error. - TODO(); + PARSE_ERROR(); } for (;;) { auto popped_element = m_stack_of_open_elements.pop(); |