On 2015/10/30 0:57, David Rajchenbach-Teller wrote:
On 29/10/15 16:32, Benoit Girard wrote:
We've explored several different ways of measuring this. Several of
these are in the tree. Generally what I have found the most useful is to
measure how we're servicing the content' main thread. This measurement
is great because its measures how responsive Firefox is not only for
scrolling/animations but nearly all use cases like typing latency.

There's EventTracer.h which is our best general responsiveness
measurement at the moment. However it only traces the event loop up to
each 20ms so it's a laggy indicator.

Thanks. However, I'm not really looking for a detector, only a flag that
will let me prune false positives.

For CSS animations/transitions (not including SVG SMIL animations), you could use:

  document.timeline.getAnimations().some(
    anim => anim.playState == 'running')

(Soon to become just document.getAnimations())

We could likewise just check if the DocumentTimeline is observing the refresh driver since we should stop doing that when CSS animations/transitions are at rest.

For rAF animations we could use the the js::NotifyAnimationActivity information? Or else look for registered frame request callbacks?

I think we could probably detect SVG SMIL animations too, if needed (perhaps by exposing the mRegisteredWithRefreshDriver member of nsSMILAnimationController although that might be too broad).
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to