From 60c32f39a18ae699013e5b8bdf7a041a2df3f24c Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Sat, 23 Sep 2023 10:52:12 +1200 Subject: [PATCH] LibWeb: Do not crash when parsing a SVG script element Just leave a FIXME dbgln message instead. This works around a crash seen in html5test.com. --- Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp index 6baaf5964ae..36fb89a8851 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp +++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp @@ -3545,7 +3545,7 @@ void HTMLParser::process_using_the_rules_for_foreign_content(HTMLToken& token) m_parser_pause_flag = true; // FIXME: If the active speculative HTML parser is null and the user agent supports SVG, then Process the SVG script element according to the SVG rules. [SVG] - TODO(); + dbgln("FIXME: Missing 'Process the SVG script element according to the SVG rules."); // Decrement the parser's script nesting level by one. decrement_script_nesting_level(); @@ -3555,7 +3555,9 @@ void HTMLParser::process_using_the_rules_for_foreign_content(HTMLToken& token) // Let the insertion point have the value of the old insertion point. m_tokenizer.restore_insertion_point(); + return; } + // -> Any other end tag if (token.is_end_tag()) { // 1. Initialize node to be the current node (the bottommost node of the stack).