diff --git a/Tests/LibWeb/Text/expected/DOM/domparser-parsefromstring-xml-empty-systemid.txt b/Tests/LibWeb/Text/expected/DOM/domparser-parsefromstring-xml-empty-systemid.txt new file mode 100644 index 00000000000..53cdf1e9393 --- /dev/null +++ b/Tests/LibWeb/Text/expected/DOM/domparser-parsefromstring-xml-empty-systemid.txt @@ -0,0 +1 @@ +PASSED diff --git a/Tests/LibWeb/Text/input/DOM/domparser-parsefromstring-xml-empty-systemid.html b/Tests/LibWeb/Text/input/DOM/domparser-parsefromstring-xml-empty-systemid.html new file mode 100644 index 00000000000..84aa9544d03 --- /dev/null +++ b/Tests/LibWeb/Text/input/DOM/domparser-parsefromstring-xml-empty-systemid.html @@ -0,0 +1,9 @@ + + diff --git a/Userland/Libraries/LibXML/Parser/Parser.cpp b/Userland/Libraries/LibXML/Parser/Parser.cpp index cd1ea593898..62a40905747 100644 --- a/Userland/Libraries/LibXML/Parser/Parser.cpp +++ b/Userland/Libraries/LibXML/Parser/Parser.cpp @@ -259,7 +259,7 @@ requires(IsCallableWithArguments) ErrorOr -requires(IsCallableWithArguments) ErrorOr Parser::expect_many(Pred predicate, StringView description) +requires(IsCallableWithArguments) ErrorOr Parser::expect_many(Pred predicate, StringView description, bool allow_empty) { auto rollback = rollback_point(); auto start = m_lexer.tell(); @@ -269,7 +269,7 @@ requires(IsCallableWithArguments) ErrorOr Parser::parse_system_id_literal() auto quote = TRY(expect(is_any_of("'\""sv), "any of ' or \""sv)); auto accept = accept_rule(); - auto id = TRY(expect_many(is_not_any_of(quote), "not a quote"sv)); + auto id = TRY(expect_many(is_not_any_of(quote), "not a quote"sv, true)); TRY(expect(quote)); rollback.disarm(); diff --git a/Userland/Libraries/LibXML/Parser/Parser.h b/Userland/Libraries/LibXML/Parser/Parser.h index bc60c9046a2..a6db08f6481 100644 --- a/Userland/Libraries/LibXML/Parser/Parser.h +++ b/Userland/Libraries/LibXML/Parser/Parser.h @@ -146,7 +146,7 @@ private: template requires(IsCallableWithArguments) ErrorOr expect(Pred, StringView description); template - requires(IsCallableWithArguments) ErrorOr expect_many(Pred, StringView description); + requires(IsCallableWithArguments) ErrorOr expect_many(Pred, StringView description, bool allow_empty = false); static size_t s_debug_indent_level; [[nodiscard]] auto rollback_point(SourceLocation location = SourceLocation::current())