mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
LibWeb: Make factory method of DOM::DocumentFragment fallible
This commit is contained in:
parent
8fbd43cb27
commit
491c18a346
Notes:
sideshowbarker
2024-07-17 23:07:41 +09:00
Author: https://github.com/kennethmyhra Commit: https://github.com/SerenityOS/serenity/commit/491c18a346 Pull-request: https://github.com/SerenityOS/serenity/pull/17491 Reviewed-by: https://github.com/linusg ✅
@ -34,10 +34,10 @@ void DocumentFragment::set_host(Web::DOM::Element* element)
|
||||
}
|
||||
|
||||
// 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());
|
||||
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()));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ class DocumentFragment
|
||||
WEB_PLATFORM_OBJECT(DocumentFragment, ParentNode);
|
||||
|
||||
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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user