Closed Bug 1504884 Opened 6 years ago Closed 6 years ago

Change AnimationInfo::mAnimationGeneration to Maybe<uint64_t> to represent the state there is actually no animation

Categories

(Core :: DOM: Animation, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla65
Tracking Status
firefox65 --- fixed

People

(Reporter: hiro, Assigned: hiro)

References

Details

Attachments

(3 files)

While I was debugging the patch for bug 1504065, I noticed that we sometimes apply unwanted change hints in RestyleManager::AddLayerChangesForAnimation() because AnimationInfo::GetGenerationFromFrame returns 0 even if the layer has no animation.  This situation happens when we created a layer for a display item (corresponding to a css property) but the layer has no animation, e.g. will-change property is specified.
I can come up with any ideas to write automated test cases for this, so I am going to attach an example to observe the issue on debugger.

The example has an element having an opacity animation and fixed transform style rotate(360deg).  We generate a transform layer and an opacity layer for this element respectively.  When we call RequestRestyle(Layer), we increase the generation on RestyleManager, and unfortunately at the time, the animation generation of the opacity layer is zero, and it will never be increased since there is no opacity animation on the layer.  Thus, every time we call RequestRestyle(Layer) we generate nsChangeHint_UpdateOpacityLayer, it's unwanted change hint.
(In reply to Hiroyuki Ikezoe (:hiro) from comment #1)
> Created attachment 9022809 [details]
> An example to see this issue
> 
> I can come up with any ideas to write automated test cases for this, so I am
> going to attach an example to observe the issue on debugger.

I *can't*
It's not used at all.
So that we don't generate anymore unnecessary change hints in
RestyleManager::AddLayerChangesForAnimation for the layer has no corresponding
animations.

Depends on D11105
Pushed by hikezoe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bf7b500919fe
Drop AnimationInfo::mLayerManager. r=birtles
https://hg.mozilla.org/integration/autoland/rev/88a82ede1bc4
Wrap AnimationInfo::mAnimationGeneration into Maybe<> and returns Nothing() if there is no animation. r=birtles
https://hg.mozilla.org/mozilla-central/rev/bf7b500919fe
https://hg.mozilla.org/mozilla-central/rev/88a82ede1bc4
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: