LibWeb: Make DOMImplementation IDL return an XMLDocument

Which the implementation was already doing, so no behaviour change :^)
This commit is contained in:
Shannon Booth 2024-05-19 21:38:56 +12:00 committed by Andreas Kling
parent f7beea1397
commit a8e3400a2a
Notes: sideshowbarker 2024-07-17 11:30:05 +09:00
3 changed files with 4 additions and 4 deletions

View File

@ -48,7 +48,7 @@ void DOMImplementation::visit_edges(Cell::Visitor& visitor)
}
// https://dom.spec.whatwg.org/#dom-domimplementation-createdocument
WebIDL::ExceptionOr<JS::NonnullGCPtr<Document>> DOMImplementation::create_document(Optional<FlyString> const& namespace_, String const& qualified_name, JS::GCPtr<DocumentType> doctype) const
WebIDL::ExceptionOr<JS::NonnullGCPtr<XMLDocument>> DOMImplementation::create_document(Optional<FlyString> const& namespace_, String const& qualified_name, JS::GCPtr<DocumentType> doctype) const
{
// 1. Let document be a new XMLDocument
auto xml_document = XMLDocument::create(realm());

View File

@ -21,7 +21,7 @@ public:
[[nodiscard]] static JS::NonnullGCPtr<DOMImplementation> create(Document&);
virtual ~DOMImplementation();
WebIDL::ExceptionOr<JS::NonnullGCPtr<Document>> create_document(Optional<FlyString> const&, String const&, JS::GCPtr<DocumentType>) const;
WebIDL::ExceptionOr<JS::NonnullGCPtr<XMLDocument>> create_document(Optional<FlyString> const&, String const&, JS::GCPtr<DocumentType>) const;
JS::NonnullGCPtr<Document> create_html_document(Optional<String> const& title) const;
WebIDL::ExceptionOr<JS::NonnullGCPtr<DocumentType>> create_document_type(String const& qualified_name, String const& public_id, String const& system_id);

View File

@ -1,11 +1,11 @@
#import <DOM/Document.idl>
#import <DOM/XMLDocument.idl>
// https://dom.spec.whatwg.org/#domimplementation
[Exposed=Window]
interface DOMImplementation {
// FIXME: This should return XMLDocument instead of Document.
[NewObject] Document createDocument([FlyString] DOMString? namespace, [LegacyNullToEmptyString] DOMString qualifiedName, optional DocumentType? doctype = null);
[NewObject] XMLDocument createDocument([FlyString] DOMString? namespace, [LegacyNullToEmptyString] DOMString qualifiedName, optional DocumentType? doctype = null);
[NewObject] Document createHTMLDocument(optional DOMString title);
[NewObject] DocumentType createDocumentType(DOMString qualifiedName, DOMString publicId, DOMString systemId);