diff options
Diffstat (limited to 'Userland/Libraries/LibWeb/DOM')
-rw-r--r-- | Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp b/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp index 28a5a11dbd..08ae8d5de2 100644 --- a/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp +++ b/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp @@ -29,12 +29,8 @@ ExceptionOr<NonnullRefPtr<Document>> DOMImplementation::create_document(const St RefPtr<Element> element; - if (!qualified_name.is_empty()) { - auto new_element = xml_document->create_element_ns(namespace_, qualified_name /* FIXME: and an empty dictionary */); - if (new_element.is_exception()) - return new_element.exception(); - element = new_element.release_value(); - } + if (!qualified_name.is_empty()) + element = TRY(xml_document->create_element_ns(namespace_, qualified_name /* FIXME: and an empty dictionary */)); if (doctype) xml_document->append_child(doctype.release_nonnull()); @@ -92,9 +88,7 @@ NonnullRefPtr<Document> DOMImplementation::create_html_document(const String& ti // https://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype ExceptionOr<NonnullRefPtr<DocumentType>> DOMImplementation::create_document_type(String const& qualified_name, String const& public_id, String const& system_id) { - auto result = Document::validate_qualified_name(qualified_name); - if (result.is_exception()) - return result.exception(); + TRY(Document::validate_qualified_name(qualified_name)); auto document_type = DocumentType::create(document()); document_type->set_name(qualified_name); document_type->set_public_id(public_id); |