Throttle prepaints to avoid colliding with post-load work
On the page cyclers (especially intl1) the prepaint logic in the compositor
interferes with the subsequent page's load time when --force-compositing-mode
is active. This is because the prepaint schedules a commit immediately
after finishing a prepaint-eligible paint. On the page cyclers, this means that
we frequently do a second commit just after starting the load on the next page
in the set since the new page's URL is set just after the onload event.
This patch tweaks the prepaint to happen only after we perform an updateLayers()
that's prepaint eligible and then go 100ms (number picked somewhat arbitrarily)
without receiving another setNeedsCommit(). The goal is to only prepaint if
the compositor scene is roughly steady - if we're still receiving invalidations
on the main content then it's less likely that prepainting will be useful.
On pages in the wild that load quickly, the first prepaint after first paint is
likely to collide with onload and shortly-after-onload logic. Delaying until we
reach a steady state shouldn't slow down static pages but will help avoid
contention and wasted work on pages that modify the page on or shortly after