Page MenuHomePhabricator

Bug 1805727 - Part 4: Implement transition-behavior for properties with discrete animation type.
ClosedPublic

Authored by boris on Feb 14 2024, 8:22 PM.
Referenced Files
Unknown Object (File)
Thu, Apr 30, 7:12 AM
Unknown Object (File)
Sun, Apr 26, 4:17 PM
Unknown Object (File)
Thu, Apr 23, 7:05 AM
Unknown Object (File)
Mon, Apr 20, 5:25 AM
Unknown Object (File)
Sun, Apr 19, 12:15 PM
Unknown Object (File)
Sun, Apr 19, 10:16 AM
Unknown Object (File)
Sun, Apr 19, 7:56 AM
Unknown Object (File)
Sat, Apr 18, 9:31 PM
Subscribers

Details

Summary

The implementation is straight-forward. We have to check
if transition-behavior is allow-discrete when trying to create a new
transition and when checking if we have to cancel a running transition.

Also, the test case is out-of-date, so I tweak it a little bit and add
more general test cases for transtiion-behavior. Besides, I enable the
preference in the WPT folders which use transition-behavior (but
those tests may be passed already or failed due to reasons other than
transition-behavior).

Event Timeline

phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
phab-bot removed a project: secure-revision.
boris added reviewers: layout-reviewers, Restricted Project, Restricted Project.Feb 14 2024, 10:06 PM
boris removed a reviewer: Restricted Project.
emilio requested changes to this revision.Feb 19 2024, 10:24 AM

I think the set might not be needed, but if it is then it needs a comment. Looks good otherwise, thanks!

layout/style/nsTransitionManager.cpp
108

Do we even need this set? We only need this to compare to existing transitions, and if a transition is ongoing the property must have been transitionable?

Or is this needed to handle the case of dynamic switching from transition-behavior: allow-discrete to initial? If so it needs the comment tweaked to say to still be discretely animated or something?

servo/ports/geckolib/glue.rs
1211

s/animationable/animatable

I would've written this as:

if !prop.is_animatable() {
    return false;
}
match behavior { .. }

But fine either way I guess :)

This revision now requires changes to proceed.Feb 19 2024, 10:24 AM
boris marked 2 inline comments as done.

Addressed comments

layout/style/nsTransitionManager.cpp
108

Yes, this is the case I was thinking of. However, I tried to add more tests for the case "dynamic switching from transition-behavior: allow-discrete to normal", and it looks like we handle this case well inside ConsiderInitiatingTransition already. So, let's revert this part.

This revision is now accepted and ready to land.Feb 23 2024, 9:07 PM