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

LibWeb: Propagate errors from parse_css_value and property_initial_value

This commit is contained in:
Sam Atkins 2023-05-02 15:09:46 +01:00 committed by Andreas Kling
parent 294f5b109f
commit f4d8a24fe4
12 changed files with 68 additions and 66 deletions

View file

@ -28,11 +28,11 @@ void SVGSVGBox::prepare_for_replaced_layout()
Optional<CSSPixels> w;
Optional<CSSPixels> h;
auto parsing_context = CSS::Parser::ParsingContext { document() };
auto width = parse_css_value(parsing_context, dom_node().attribute(Web::HTML::AttributeNames::width), CSS::PropertyID::Width);
auto width = parse_css_value(parsing_context, dom_node().attribute(Web::HTML::AttributeNames::width), CSS::PropertyID::Width).release_value_but_fixme_should_propagate_errors();
if (!width.is_null() && width->has_length())
w = width->to_length().to_px(*this);
auto height = parse_css_value(parsing_context, dom_node().attribute((HTML::AttributeNames::height)), CSS::PropertyID::Height);
auto height = parse_css_value(parsing_context, dom_node().attribute((HTML::AttributeNames::height)), CSS::PropertyID::Height).release_value_but_fixme_should_propagate_errors();
if (!height.is_null() && height->has_length())
h = height->to_length().to_px(*this);
if (w.has_value() && h.has_value()) {