From efbf6b7e5fae4d6e84859a9fa1c27053d0a86d2b Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Wed, 7 Jun 2023 12:00:00 +0200 Subject: [PATCH] LibWeb: Make HashMap copy of inline CSS declarations fallible --- Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp b/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp index ce5266992f0..4767b2ded8a 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp @@ -458,7 +458,8 @@ WebIDL::ExceptionOr ElementInlineCSSStyleDeclaration::set_css_text(StringV // 3. Parse the given value and, if the return value is not the empty list, insert the items in the list into the declarations, in specified order. auto style = parse_css_style_attribute(CSS::Parser::ParsingContext(m_element->document()), css_text, *m_element.ptr()); - set_the_declarations(style->properties(), style->custom_properties()); + auto custom_properties = TRY_OR_THROW_OOM(vm(), style->custom_properties().clone()); + set_the_declarations(style->properties(), move(custom_properties)); // 4. Update style attribute for the CSS declaration block. update_style_attribute();