mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-05 23:59:53 +00:00
LibWeb: Return base Document for non-HTML parses
The HTML specification does not explicitly require a specific return type for parseFromString(), but according to Web Platform TestsDOMParser-parseFromString.html, the expected return value for XML MIME types is a Document—not an XMLDocument.
This commit is contained in:
parent
acc7c2f7f3
commit
acf1fe7b05
Notes:
github-actions[bot]
2025-07-25 16:09:39 +00:00
Author: https://github.com/mikiubo
Commit: acf1fe7b05
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5557
Reviewed-by: https://github.com/ADKaster ✅
4 changed files with 104 additions and 2 deletions
|
@ -56,7 +56,7 @@ GC::Ref<DOM::Document> DOMParser::parse_from_string(StringView string, Bindings:
|
|||
document->parse_html_from_a_string(string);
|
||||
} else {
|
||||
// -> Otherwise
|
||||
document = DOM::XMLDocument::create(realm(), associated_document.url());
|
||||
document = DOM::Document::create(realm(), associated_document.url());
|
||||
document->set_content_type(Bindings::idl_enum_to_string(type));
|
||||
document->set_document_type(DOM::Document::Type::XML);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue