mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-03 08:52:54 +00:00
LibWeb: Create XMLDocuments in DOMImplementation.createDocument
This commit is contained in:
parent
36c145b197
commit
cd156bad6b
Notes:
sideshowbarker
2024-07-16 17:05:37 +09:00
Author: https://github.com/shannonbooth
Commit: cd156bad6b
Pull-request: https://github.com/SerenityOS/serenity/pull/22567
Reviewed-by: https://github.com/awesomekling
3 changed files with 11 additions and 3 deletions
|
@ -0,0 +1 @@
|
||||||
|
XMLDocument
|
|
@ -0,0 +1,7 @@
|
||||||
|
<script src="../include.js"></script>
|
||||||
|
<script>
|
||||||
|
test(() => {
|
||||||
|
const xmlDoc = document.implementation.createDocument(null, "books");
|
||||||
|
println(xmlDoc.constructor.name);
|
||||||
|
});
|
||||||
|
</script>
|
|
@ -8,10 +8,10 @@
|
||||||
#include <LibWeb/Bindings/Intrinsics.h>
|
#include <LibWeb/Bindings/Intrinsics.h>
|
||||||
#include <LibWeb/Bindings/MainThreadVM.h>
|
#include <LibWeb/Bindings/MainThreadVM.h>
|
||||||
#include <LibWeb/DOM/DOMImplementation.h>
|
#include <LibWeb/DOM/DOMImplementation.h>
|
||||||
#include <LibWeb/DOM/Document.h>
|
|
||||||
#include <LibWeb/DOM/DocumentType.h>
|
#include <LibWeb/DOM/DocumentType.h>
|
||||||
#include <LibWeb/DOM/ElementFactory.h>
|
#include <LibWeb/DOM/ElementFactory.h>
|
||||||
#include <LibWeb/DOM/Text.h>
|
#include <LibWeb/DOM/Text.h>
|
||||||
|
#include <LibWeb/DOM/XMLDocument.h>
|
||||||
#include <LibWeb/HTML/Origin.h>
|
#include <LibWeb/HTML/Origin.h>
|
||||||
#include <LibWeb/Namespace.h>
|
#include <LibWeb/Namespace.h>
|
||||||
|
|
||||||
|
@ -48,8 +48,8 @@ void DOMImplementation::visit_edges(Cell::Visitor& visitor)
|
||||||
// https://dom.spec.whatwg.org/#dom-domimplementation-createdocument
|
// https://dom.spec.whatwg.org/#dom-domimplementation-createdocument
|
||||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<Document>> DOMImplementation::create_document(Optional<String> const& namespace_, String const& qualified_name, JS::GCPtr<DocumentType> doctype) const
|
WebIDL::ExceptionOr<JS::NonnullGCPtr<Document>> DOMImplementation::create_document(Optional<String> const& namespace_, String const& qualified_name, JS::GCPtr<DocumentType> doctype) const
|
||||||
{
|
{
|
||||||
// FIXME: 1. Let document be a new XMLDocument
|
// 1. Let document be a new XMLDocument
|
||||||
auto xml_document = Document::create(realm());
|
auto xml_document = XMLDocument::create(realm());
|
||||||
|
|
||||||
xml_document->set_ready_for_post_load_tasks(true);
|
xml_document->set_ready_for_post_load_tasks(true);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue