mirror of
https://github.com/RGBCube/serenity
synced 2025-07-07 16:47:36 +00:00
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. :^)
This commit is contained in:
parent
406fd95f32
commit
50265858ab
1 changed files with 6 additions and 2 deletions
|
@ -41,6 +41,11 @@
|
||||||
ASSERT_NOT_REACHED(); \
|
ASSERT_NOT_REACHED(); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
#define PARSE_ERROR() \
|
||||||
|
do { \
|
||||||
|
dbg() << "Parse error!"; \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
namespace Web {
|
namespace Web {
|
||||||
|
|
||||||
HTMLDocumentParser::HTMLDocumentParser(const StringView& input)
|
HTMLDocumentParser::HTMLDocumentParser(const StringView& input)
|
||||||
|
@ -353,8 +358,7 @@ void HTMLDocumentParser::close_a_p_element()
|
||||||
{
|
{
|
||||||
generate_implied_end_tags("p");
|
generate_implied_end_tags("p");
|
||||||
if (current_node().tag_name() != "p") {
|
if (current_node().tag_name() != "p") {
|
||||||
// Parse error.
|
PARSE_ERROR();
|
||||||
TODO();
|
|
||||||
}
|
}
|
||||||
for (;;) {
|
for (;;) {
|
||||||
auto popped_element = m_stack_of_open_elements.pop();
|
auto popped_element = m_stack_of_open_elements.pop();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue