New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LibWeb: More animation fixes #23486
LibWeb: More animation fixes #23486
Conversation
Style computation should never fail. Instead, we just ignore the transformation that led to the invalid matrix.
Hello! One or more of the commit messages in this PR do not match the SerenityOS code submission policy, please check the |
} else { | ||
// If interpolate_property() fails, the element should not be rendered | ||
dbgln_if(LIBWEB_CSS_ANIMATION_DEBUG, "Interpolated value for property {} at {}: {} -> {} is invalid", string_from_property_id(it.key), progress_in_keyframe, start->to_string(), end->to_string()); | ||
style_properties.set_property(PropertyID::Visibility, IdentifierStyleValue::create(ValueID::Hidden)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a sensible way to accomplish "not rendering" the element? It feels odd, but I wasn't sure how else to do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not entirely sure what's the best strategy here.
Overriding the visibility
property is probably not entirely correct since it's observable from JavaScript, but we can do it this way for now, and then figure out something different after we look at how other browsers behave :)
9e0aac8
to
fa07451
Compare
All of this error propogation came from a single call to HashMap::try_ensure_capacity! As part of the ongoing effort to ignore small allocation failures, lets just assert this works. This has the nice side-effect of propogating out to a few other classes.
In this case, the StyleValue may be "unresolved", however let's just avoid the assert altogether and treat all non-transform values as "none".
Animation::play_state() does not consider the fill state, and thus will not return "Playing" for a fill-forward animation in the after phase. It is still valid for paused, as pausing is not affected by the fill mode.
fa07451
to
e312528
Compare
e312528
to
68f1d2c
Compare
Fixes #23473, fixes #23471. Also fixes an overly-excited button on shopify.com (the hover animation was blinking on and off). Note that it uses transitions to animate on hover, so the fact that it now no longer animates at all is expected.