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

LibWeb: Use new parse_length() in shadow parsing

This commit is contained in:
Sam Atkins 2023-12-28 17:47:58 +00:00 committed by Andreas Kling
parent bf05aa88bc
commit e0875b99cc

View file

@ -3580,15 +3580,11 @@ RefPtr<StyleValue> Parser::parse_single_shadow_value(TokenStream<ComponentValue>
Optional<ShadowPlacement> placement;
auto possibly_dynamic_length = [&](ComponentValue const& token) -> RefPtr<StyleValue> {
if (auto calculated_value = parse_calculated_value(token)) {
if (!calculated_value->resolves_to_length())
return nullptr;
return calculated_value;
}
auto maybe_length = parse_length(token);
auto tokens = TokenStream<ComponentValue>::of_single_token(token);
auto maybe_length = parse_length(tokens);
if (!maybe_length.has_value())
return nullptr;
return LengthStyleValue::create(maybe_length.release_value());
return maybe_length->as_style_value();
};
while (tokens.has_next_token()) {