LibJS: Make Cell::initialize() return void

Stop worrying about tiny OOMs.

Work towards #20405
This commit is contained in:
Andreas Kling 2023-08-07 08:41:28 +02:00
parent fde26c53f0
commit 18c54d8d40
Notes: sideshowbarker 2024-07-17 05:09:48 +09:00
804 changed files with 1330 additions and 2171 deletions

View file

@ -21,23 +21,21 @@ SVGUseElement::SVGUseElement(DOM::Document& document, DOM::QualifiedName qualifi
{
}
JS::ThrowCompletionOr<void> SVGUseElement::initialize(JS::Realm& realm)
void SVGUseElement::initialize(JS::Realm& realm)
{
MUST_OR_THROW_OOM(Base::initialize(realm));
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGUseElementPrototype>(realm, "SVGUseElement"));
// The shadow tree is open (inspectable by script), but read-only.
auto shadow_root = TRY(heap().allocate<DOM::ShadowRoot>(realm, document(), *this, Bindings::ShadowRootMode::Open));
auto shadow_root = MUST(heap().allocate<DOM::ShadowRoot>(realm, document(), *this, Bindings::ShadowRootMode::Open));
// The user agent must create a use-element shadow tree whose host is the use element itself
set_shadow_root(shadow_root);
m_document_observer = TRY(realm.heap().allocate<DOM::DocumentObserver>(realm, realm, document()));
m_document_observer = MUST(realm.heap().allocate<DOM::DocumentObserver>(realm, realm, document()));
m_document_observer->document_completely_loaded = [this]() {
clone_element_tree_as_our_shadow_tree(referenced_element());
};
return {};
}
void SVGUseElement::visit_edges(Cell::Visitor& visitor)