Skip to content
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

Merged

Conversation

mattco98
Copy link
Collaborator

@mattco98 mattco98 commented Mar 6, 2024

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.

Style computation should never fail. Instead, we just ignore the
transformation that led to the invalid matrix.
@mattco98 mattco98 requested a review from AtkinsSJ as a code owner March 6, 2024 02:51
@github-actions github-actions bot added the 👀 pr-needs-review PR needs review from a maintainer or community member label Mar 6, 2024
@BuggieBot
Copy link
Member

Hello!

One or more of the commit messages in this PR do not match the SerenityOS code submission policy, please check the lint_commits CI job for more details on which commits were flagged and why.
Please do not close this PR and open another, instead modify your commit message(s) with git commit --amend and force push those changes to update this PR.

} 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));
Copy link
Collaborator Author

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.

Copy link
Member

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 :)

@mattco98 mattco98 force-pushed the libweb-more-animation-fixes branch from 9e0aac8 to fa07451 Compare March 6, 2024 02:54
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.
@mattco98 mattco98 force-pushed the libweb-more-animation-fixes branch from fa07451 to e312528 Compare March 6, 2024 02:55
@mattco98 mattco98 force-pushed the libweb-more-animation-fixes branch from e312528 to 68f1d2c Compare March 6, 2024 03:02
@awesomekling awesomekling merged commit 8f3b97e into SerenityOS:master Mar 6, 2024
13 checks passed
@github-actions github-actions bot removed the 👀 pr-needs-review PR needs review from a maintainer or community member label Mar 6, 2024
@mattco98 mattco98 deleted the libweb-more-animation-fixes branch March 6, 2024 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LibWeb: Style computer should never fail Ladybird: apple.com crash in interpolate_transform
3 participants