mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb: Implement XMLFragmentParser
Implement XMLFragmentParser based on the specification: https://html.spec.whatwg.org/multipage/xhtml.html Fixes one WPT in: domparsing/insert_adjacent_html-xhtml.xhtml
This commit is contained in:
Notes:
github-actions[bot]
2025-10-23 10:08:05 +00:00
Author: https://github.com/mikiubo Commit: https://github.com/LadybirdBrowser/ladybird/commit/5b2a71a712e Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6157 Reviewed-by: https://github.com/AtkinsSJ ✅
@@ -92,6 +92,7 @@
|
||||
#include <LibWeb/WebIDL/AbstractOperations.h>
|
||||
#include <LibWeb/WebIDL/DOMException.h>
|
||||
#include <LibWeb/WebIDL/ExceptionOr.h>
|
||||
#include <LibWeb/XML/XMLFragmentParser.h>
|
||||
|
||||
namespace Web::DOM {
|
||||
|
||||
@@ -2054,9 +2055,9 @@ WebIDL::ExceptionOr<GC::Ref<DOM::DocumentFragment>> Element::parse_fragment(Stri
|
||||
// 1. Let algorithm be the HTML fragment parsing algorithm.
|
||||
auto algorithm = HTML::HTMLParser::parse_html_fragment;
|
||||
|
||||
// FIXME: 2. If context's node document is an XML document, then set algorithm to the XML fragment parsing algorithm.
|
||||
// 2. If context's node document is an XML document, then set algorithm to the XML fragment parsing algorithm.
|
||||
if (document().is_xml_document()) {
|
||||
dbgln("FIXME: Handle fragment parsing of XML documents");
|
||||
algorithm = XMLFragmentParser::parse_xml_fragment;
|
||||
}
|
||||
|
||||
// 3. Let newChildren be the result of invoking algorithm given context and markup.
|
||||
|
||||
Reference in New Issue
Block a user