LibWeb: Don't crash when encountering calc() inside a CSS rect() value

This allows us to run the WPT tests under quirks/unitless-length/
without crashing, giving us over 4600 new passing subtests. :^)
This commit is contained in:
Andreas Kling 2024-10-09 13:44:34 +02:00 committed by Tim Ledbetter
commit 5df6c6eecf
Notes: github-actions[bot] 2024-10-09 13:15:10 +00:00
3 changed files with 20 additions and 1 deletions

View file

@ -2710,7 +2710,10 @@ RefPtr<CSSStyleValue> Parser::parse_rect_value(TokenStream<ComponentValue>& toke
auto maybe_length = parse_length(argument_tokens);
if (!maybe_length.has_value())
return nullptr;
// FIXME: Support calculated lengths
if (maybe_length.value().is_calculated()) {
dbgln("FIXME: Support calculated lengths in rect(): {}", maybe_length.value().calculated()->to_string());
return nullptr;
}
params.append(maybe_length.value().value());
}
argument_tokens.skip_whitespace();