[webkit-dev] Detecting a finished paint via JavaScript
David Hyatt
hyatt at apple.com
Wed Jul 8 11:03:59 PDT 2009
This still omits the cost of painting from a benchmark though.
dave
On Jul 8, 2009, at 12:57 PM, Darin Fisher wrote:
> While this is not a perfect solution, a common technique is to call
> (from onload) a DOM method like offsetHeight that forces layout to
> run. That way the bulk of the work required to paint is forced to
> happen before the benchmark considers the page load complete.
>
> -Darin
>
>
>
> On Wed, Jul 8, 2009 at 10:45 AM, RDC <rdc49360 at googlemail.com> wrote:
> Would you be willing elaborate on why you want this?
>
> Of course; I would like it for benchmarking page rendering times--
> something I believe would be possible with Web Inspector, but I'm
> after a cross-browser way of achieving it.
>
> At the moment I have a benchmark that uses the onLoad event to move
> onto the next page; on Firefox this sometimes results in pages being
> "skipped" as the onLoad event is triggered before any painting is
> done. We use the mozAfterPaint to control this somewhat (though not
> completely effectively--any DOM manipulation via JS causes further
> paint events, but by this time the onLoad has fired).
>
> Thinking more about it, perhaps it is the case that WebKit doesn't
> behave in exactly the same way, and the afterPaint event is not
> needed to guarantee that at least *some* of the page is painted
> before moving on.
>
> -R
>
>
>
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20090708/2a0487d5/attachment.html>
More information about the webkit-dev
mailing list