don't tick SMIL animations as much when in a background tab




7 years ago
7 years ago


(Reporter: heycam, Unassigned)


(Blocks: 1 bug, {perf})


Firefox Tracking Flags

(Not tracked)




7 years ago
It should be possible to ensure SMIL animations do not tick as much when they are in a background tab page, for example it could only tick for times where the animation would be ending, causing other animations to start/end due to syncbase times, firing repeat events, etc.  Script might be inspecting animated values in the DOM, so we'd need to ensure we could tick the animation if it is out of date when script does this.

Brian says we already keep a track of "significant milestones" in an animation, which might help.
Is there a tick here separate from the refresh driver?
(In reply to Boris Zbarsky (:bz) from comment #1)
> Is there a tick here separate from the refresh driver?

No. Animation samples are based off the refresh driver so we should benefit at least from throttling of the refresh driver. But this bug is about being more aggressive still. Perhaps we could skip samples altogether if:

a) we are in a background tab, and
b) we haven't reached the next milestone yet, and
c) we haven't add any explicit requests for a refresh (from SVG)
I'm considering turning off the refresh driver altogether in background tabs, actually...  I just need to convince roc.  ;)

But even as it is, we do exponential backoff right now.  So once a page goes in a background tab we set the refresh driver to 1s, and after N seconds have elapsed it won't tick more often than about every N seconds.  Which means that in practice you don't get much ticking going on in background tabs.
Version: unspecified → Trunk


7 years ago
Keywords: perf
Blocks: 732323
You need to log in before you can comment on or make changes to this bug.