LibWeb: Make factory methods of DOM::Document fallible

This commit is contained in:
Kenneth Myhra 2023-02-14 21:49:02 +01:00 committed by Linus Groh
commit 0d9076c9f5
Notes: sideshowbarker 2024-07-17 09:49:33 +09:00
8 changed files with 17 additions and 24 deletions

View file

@ -730,7 +730,7 @@ JS::NonnullGCPtr<Node> Node::clone_node(Document* document, bool clone_children)
else if (is<Document>(this)) {
// Document
auto document_ = verify_cast<Document>(this);
auto document_copy = Document::create(this->realm(), document_->url());
auto document_copy = Document::create(this->realm(), document_->url()).release_value_but_fixme_should_propagate_errors();
// Set copys encoding, content type, URL, origin, type, and mode to those of node.
document_copy->set_encoding(document_->encoding());