Skip to content

Commit efbf6b7

Browse files
BenWiederhakeawesomekling
authored andcommitted
LibWeb: Make HashMap copy of inline CSS declarations fallible
1 parent 592e6c8 commit efbf6b7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,8 @@ WebIDL::ExceptionOr<void> ElementInlineCSSStyleDeclaration::set_css_text(StringV
458458

459459
// 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.
460460
auto style = parse_css_style_attribute(CSS::Parser::ParsingContext(m_element->document()), css_text, *m_element.ptr());
461-
set_the_declarations(style->properties(), style->custom_properties());
461+
auto custom_properties = TRY_OR_THROW_OOM(vm(), style->custom_properties().clone());
462+
set_the_declarations(style->properties(), move(custom_properties));
462463

463464
// 4. Update style attribute for the CSS declaration block.
464465
update_style_attribute();

0 commit comments

Comments
 (0)