Animated element sometimes flashes at the end of the animation

RESOLVED FIXED in Firefox 66

Status

()

defect
P4
normal
RESOLVED FIXED
8 months ago
6 months ago

People

(Reporter: nchevobbe, Assigned: sotaro)

Tracking

(Blocks 1 bug)

Trunk
mozilla66
Unspecified
All
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox65 disabled, firefox66 fixed)

Details

()

Attachments

(3 attachments)

**Steps to reproduce**
1. Go to `data:text/html,<meta charset=utf8><style>h1 {animation: 1.1s linear appears;}@keyframes appears {0% {opacity: 0;}100% {opacity: 1;}}</style><h1>Hello</h1>`


**Expected results**

The "Hello" text slowly appears. At the end of the animation, the text stays visible

**Actual results**

Sometimes, there's a flash at the end of the animation (see attached screencast, at 2-3s).
You can reload the tab a few times, I usually reproduce this in 3 tries.
This only seems to happen with webRender enabled

---
Priority: -- → P3
What platform do you see this on?
Flags: needinfo?(nchevobbe)
OSX
Flags: needinfo?(nchevobbe)
I tried the STR in comment 0 with latest nightly on osx, win10 and linux, but could not reproduce the problem.
It might be similar to Bug 1497852.
See Also: → 1497852
Getting a WR capture here would probably help. Might not be too hard to modify the code to just grab a capture for every frame in an OMTA and then just pick out the bad frame.
Nicolas, can you reproduce this problem on Windows?
Flags: needinfo?(nchevobbe)
Priority: P3 → P4
I could reproduce the problem by adding latency in LowPrioritySceneBuilder::process_transaction() from it. The problem seemed to be caused by async animation.
With attachment 9034650 [details] [diff] [review] , I reproduce  the parobem with STR in comment 0.

And when I disabled async animation by pref layers.offmainthreadcomposition.async-animations:false, I did not see the problem.
WebRenderBridgeParent::RemoveEpochDataPriorTo() seems to delete animation too early.

WebRenderLayerManager::DiscardCompositorAnimations() was called just before calling WrBridge()->EndTransaction() in WebRenderLayerManager::EndTransactionWithoutLayer(). Then WebRenderBridgeParent::RecvDeleteCompositorAnimations() was called just before WebRenderBridgeParent::RecvSetDisplayList() call. The RecvSetDisplayList() update WrEpoch. Then the RecvDeleteCompositorAnimations() stored old epoch in mCompositorAnimationsToDelete.

https://dxr.mozilla.org/mozilla-central/source/gfx/layers/wr/WebRenderBridgeParent.cpp#778
It seems better to call WebRenderLayerManager::DiscardCompositorAnimations() after calling WrBridge()->EndTransaction() in WebRenderLayerManager::EndTransactionWithoutLayer().
Blocks: 1458414
> Nicolas, can you reproduce this problem on Windows?

I tried with the STR, reloading the page ~50 times and couldn't reproduce it.
Flags: needinfo?(nchevobbe)
Blocks: 1497852
Pushed by sikeda@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/ed51ef14289e
Call DiscardCompositorAnimations() after calling WrBridge()->EndTransaction() r=kats
OS: Mac OS X → All
Status: NEW → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
Duplicate of this bug: 1514389
You need to log in before you can comment on or make changes to this bug.