diff options
author | Kenneth Myhra <kennethmyhra@gmail.com> | 2023-02-19 16:22:24 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-02-22 09:55:33 +0100 |
commit | ff92324fa563a89513c387e65b76495b7eec16fa (patch) | |
tree | 61dabc6e9baa7801d44a852c0606e812968577f7 /Userland/Libraries/LibWeb/HTML/Parser | |
parent | a2381a672db518e4af9087eb382ed417e66a1a52 (diff) | |
download | serenity-ff92324fa563a89513c387e65b76495b7eec16fa.zip |
LibWeb: Make factory method of DOM::ElementFactory fallible
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/Parser')
-rw-r--r-- | Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp index b8148c3fee..cb480c1baf 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp +++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp @@ -536,8 +536,8 @@ void HTMLParser::handle_before_html(HTMLToken& token) // -> Anything else AnythingElse: // Create an html element whose node document is the Document object. Append it to the Document object. Put this element in the stack of open elements. - auto element = create_element(document(), HTML::TagNames::html, Namespace::HTML); - MUST(document().append_child(*element)); + auto element = create_element(document(), HTML::TagNames::html, Namespace::HTML).release_value_but_fixme_should_propagate_errors(); + MUST(document().append_child(element)); m_stack_of_open_elements.push(element); // Switch the insertion mode to "before head", then reprocess the token. @@ -638,7 +638,7 @@ JS::NonnullGCPtr<DOM::Element> HTMLParser::create_element_for(HTMLToken const& t // 9. Let element be the result of creating an element given document, localName, given namespace, null, and is. // FIXME: If will execute script is true, set the synchronous custom elements flag; otherwise, leave it unset. // FIXME: Pass in `null` and `is`. - auto element = create_element(*document, local_name, namespace_); + auto element = create_element(*document, local_name, namespace_).release_value_but_fixme_should_propagate_errors(); // 10. Append each attribute in the given token to element. // FIXME: This isn't the exact `append` the spec is talking about. @@ -3499,7 +3499,7 @@ Vector<JS::Handle<DOM::Node>> HTMLParser::parse_html_fragment(DOM::Element& cont } // 5. Let root be a new html element with no attributes. - auto root = create_element(context_element.document(), HTML::TagNames::html, Namespace::HTML); + auto root = create_element(context_element.document(), HTML::TagNames::html, Namespace::HTML).release_value_but_fixme_should_propagate_errors(); // 6. Append the element root to the Document node created above. MUST(temp_document->append_child(root)); |