1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:47:36 +00:00

LibWeb: Make factory method of DOM::DocumentFragment fallible

This commit is contained in:
Kenneth Myhra 2023-02-14 20:43:19 +01:00 committed by Linus Groh
parent 8fbd43cb27
commit 491c18a346
2 changed files with 3 additions and 3 deletions

View file

@ -34,10 +34,10 @@ void DocumentFragment::set_host(Web::DOM::Element* element)
} }
// https://dom.spec.whatwg.org/#dom-documentfragment-documentfragment // https://dom.spec.whatwg.org/#dom-documentfragment-documentfragment
JS::NonnullGCPtr<DocumentFragment> DocumentFragment::construct_impl(JS::Realm& realm) WebIDL::ExceptionOr<JS::NonnullGCPtr<DocumentFragment>> DocumentFragment::construct_impl(JS::Realm& realm)
{ {
auto& window = verify_cast<HTML::Window>(realm.global_object()); auto& window = verify_cast<HTML::Window>(realm.global_object());
return realm.heap().allocate<DocumentFragment>(realm, window.associated_document()).release_allocated_value_but_fixme_should_propagate_errors(); return MUST_OR_THROW_OOM(realm.heap().allocate<DocumentFragment>(realm, window.associated_document()));
} }
} }

View file

@ -19,7 +19,7 @@ class DocumentFragment
WEB_PLATFORM_OBJECT(DocumentFragment, ParentNode); WEB_PLATFORM_OBJECT(DocumentFragment, ParentNode);
public: public:
static JS::NonnullGCPtr<DocumentFragment> construct_impl(JS::Realm& realm); static WebIDL::ExceptionOr<JS::NonnullGCPtr<DocumentFragment>> construct_impl(JS::Realm& realm);
virtual ~DocumentFragment() override = default; virtual ~DocumentFragment() override = default;