LibWeb: Let HTML parser handle EOF inserted by document.close()

Before this change, the explicit EOF inserted by document.close() would
instantly abort the parser. This meant that parsing algorithms that ran
as part of the parser unwinding on EOF would never actually run.

591 new passes in WPT/html/syntax/parsing/ :^)

This exposed a problem where the parser would try to insert a root
<html> element on EOF in a document where someone already inserted such
an element via direct DOM manipulation. The parser now gracefully
handles this scenario. It's covered by existing tests (which would
crash without this change.)
This commit is contained in:
Andreas Kling
2025-02-19 12:05:51 +01:00
committed by Andreas Kling
parent dc652aee75
commit 6f7b865cd1
Notes: github-actions[bot] 2025-02-20 13:33:49 +00:00
48 changed files with 669 additions and 685 deletions

View File

@@ -2,9 +2,8 @@ Harness status: OK
Found 4 tests
3 Pass
1 Fail
Fail document.open() sets document to no-quirks mode (write no doctype)
4 Pass
Pass document.open() sets document to no-quirks mode (write no doctype)
Pass document.open() sets document to no-quirks mode (write old doctype)
Pass document.open() sets document to no-quirks mode (write new doctype)
Pass document.open() sets document to no-quirks mode, not limited-quirks mode