requestAnimationFrame loops can happen without painting

NEW
Unassigned

Status

()

6 years ago
5 years ago

People

(Reporter: taras.mozilla, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

6 years ago
Created attachment 708227 [details]
sample code for counting paintless RAFs

I noticed that if I do requestAnimationFrame loops during pageload and poll mozPaintCount, a large percentage of requestAnimationFrame-callback happen without a change in mozPaintCount.  I have this setup on my blog and ratio of paintless-RAF-callbacks to paintcounts before onload can be 40 to 16.
We do suppress painting during page load. By default it is 250 ms, or page load, whichever comes first. You can change the 250 value using the pref nglayout.initialpaint.delay in order to test.
(Reporter)

Comment 2

6 years ago
(In reply to Timothy Nikkel (:tn) from comment #1)
> We do suppress painting during page load. By default it is 250 ms, or page
> load, whichever comes first. You can change the 250 value using the pref
> nglayout.initialpaint.delay in order to test.

There must be something else at play here. 40 suppressed RAF paints accounts for ~664ms
(Reporter)

Comment 3

6 years ago
Created attachment 709170 [details]
standalone testcase

So a couple of things
a) Tn you are right. We fire of a paintless stream of RAFs that lasts ~ nglayout.initialpaint.delay before painting starts.

I think this is a problematic behavior.
We probably should schedule the initial RAF to take |nglayout.initialpaint.delay| - 16.6ms

b) This one is pretty obvious. mozPaintCount only reports paints, so if there was no paint requested by the RAF to force to keep things painting, no painting is done.
Attachment #708227 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.