1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 00:17:36 +00:00

LibWeb: Make factory methods of CSS::CSSStyleDeclaration fallible

This commit is contained in:
Kenneth Myhra 2023-02-12 23:22:53 +01:00 committed by Linus Groh
parent 48872cd190
commit c950d1904a
4 changed files with 10 additions and 10 deletions

View file

@ -2242,7 +2242,7 @@ ElementInlineCSSStyleDeclaration* Parser::parse_as_style_attribute(DOM::Element&
{
auto declarations_and_at_rules = parse_a_list_of_declarations(m_token_stream);
auto [properties, custom_properties] = extract_properties(declarations_and_at_rules);
return ElementInlineCSSStyleDeclaration::create(element, move(properties), move(custom_properties));
return ElementInlineCSSStyleDeclaration::create(element, move(properties), move(custom_properties)).release_value_but_fixme_should_propagate_errors();
}
Optional<AK::URL> Parser::parse_url_function(ComponentValue const& component_value, AllowedDataUrlType allowed_data_url_type)
@ -3149,7 +3149,7 @@ auto Parser::extract_properties(Vector<DeclarationOrAtRule> const& declarations_
PropertyOwningCSSStyleDeclaration* Parser::convert_to_style_declaration(Vector<DeclarationOrAtRule> const& declarations_and_at_rules)
{
auto [properties, custom_properties] = extract_properties(declarations_and_at_rules);
return PropertyOwningCSSStyleDeclaration::create(m_context.realm(), move(properties), move(custom_properties));
return PropertyOwningCSSStyleDeclaration::create(m_context.realm(), move(properties), move(custom_properties)).release_value_but_fixme_should_propagate_errors();
}
Optional<StyleProperty> Parser::convert_to_style_property(Declaration const& declaration)
@ -7407,7 +7407,7 @@ CSS::CSSStyleSheet* parse_css_stylesheet(CSS::Parser::ParsingContext const& cont
CSS::ElementInlineCSSStyleDeclaration* parse_css_style_attribute(CSS::Parser::ParsingContext const& context, StringView css, DOM::Element& element)
{
if (css.is_empty())
return CSS::ElementInlineCSSStyleDeclaration::create(element, {}, {});
return CSS::ElementInlineCSSStyleDeclaration::create(element, {}, {}).release_value_but_fixme_should_propagate_errors();
CSS::Parser::Parser parser(context, css);
return parser.parse_as_style_attribute(element);
}