LibWeb: Store underlying RatioStyleValue values as StyleValues

Previously we stored a fully formed `Ratio` - this restricted us from
supporting calculated values which will be implemented in a later commit
This commit is contained in:
Callum Law
2026-03-23 21:43:45 +13:00
committed by Tim Ledbetter
parent 9f8ffc3ad0
commit f347be8206
Notes: github-actions[bot] 2026-03-24 14:01:44 +00:00
8 changed files with 59 additions and 29 deletions

View File

@@ -2837,7 +2837,7 @@ RefPtr<StyleValue const> Parser::parse_nonnegative_integer_symbol_pair_value(Tok
RefPtr<StyleValue const> Parser::parse_ratio_value(TokenStream<ComponentValue>& tokens)
{
if (auto ratio = parse_ratio(tokens); ratio.has_value())
return RatioStyleValue::create(ratio.release_value());
return RatioStyleValue::create(NumberStyleValue::create(ratio->numerator()), NumberStyleValue::create(ratio->denominator()));
return nullptr;
}