LibWeb: Fix crash for calculated transition duration/delays

As the parser was trying to directly unwrap an unresolved duration.
Currently we are outputting the wrong results for the serialized
duration, but this is still a step forwards.

Fixes a crash seen on: https://evaparish.com/blog/how-i-edit
This commit is contained in:
Shannon Booth 2024-04-06 14:16:51 +02:00 committed by Sam Atkins
commit 18520561e7
Notes: sideshowbarker 2024-07-17 05:09:48 +09:00
5 changed files with 24 additions and 6 deletions

View file

@ -5354,10 +5354,10 @@ RefPtr<StyleValue> Parser::parse_transition_value(TokenStream<ComponentValue>& t
if (auto time = parse_time(tokens); time.has_value()) {
switch (time_value_count) {
case 0:
transition.duration = time.release_value().value();
transition.duration = time.release_value();
break;
case 1:
transition.delay = time.release_value().value();
transition.delay = time.release_value();
break;
default:
dbgln_if(CSS_PARSER_DEBUG, "Transition property has more than two time values");