mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 15:16:14 +00:00
LibWeb: Make factory methods of CSS::CSSStyleDeclaration fallible
This commit is contained in:
committed by
Linus Groh
parent
48872cd190
commit
c950d1904a
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user