LibWeb: Make external StyleValue-parsing methods infallible

This commit is contained in:
Sam Atkins 2023-08-19 15:01:21 +01:00 committed by Andreas Kling
parent 9e1bbfbd37
commit 28c2836c24
Notes: sideshowbarker 2024-07-17 01:12:07 +09:00
13 changed files with 70 additions and 70 deletions

View file

@ -33,11 +33,11 @@ void SVGStopElement::apply_presentational_hints(CSS::StyleProperties& style) con
for_each_attribute([&](auto& name, auto& value) {
CSS::Parser::ParsingContext parsing_context { document() };
if (name.equals_ignoring_ascii_case("stop-color"sv)) {
if (auto stop_color = parse_css_value(parsing_context, value, CSS::PropertyID::StopColor).release_value_but_fixme_should_propagate_errors()) {
if (auto stop_color = parse_css_value(parsing_context, value, CSS::PropertyID::StopColor)) {
style.set_property(CSS::PropertyID::StopColor, stop_color.release_nonnull());
}
} else if (name.equals_ignoring_ascii_case("stop-opacity"sv)) {
if (auto stop_opacity = parse_css_value(parsing_context, value, CSS::PropertyID::StopOpacity).release_value_but_fixme_should_propagate_errors()) {
if (auto stop_opacity = parse_css_value(parsing_context, value, CSS::PropertyID::StopOpacity)) {
style.set_property(CSS::PropertyID::StopOpacity, stop_opacity.release_nonnull());
}
}