[webkit-dev] Initial painting time changed?

James Robinson jamesr at google.com
Mon Jan 30 10:38:39 PST 2012


On Mon, Jan 30, 2012 at 3:56 AM, Nikolas Zimmermann <
zimmermann at physik.rwth-aachen.de> wrote:

> Good evening WebKit folks,
>
> while working on some SVG Filter dynamic update issues I found out that
> long-standing assumptions about the paint time don't hold anymore:
>
> <svg>
> <rect id="rect" width="1" height="100"/>
> <script>
> function doTest() {
>   document.getElementById("rect").setAttribute("width", "100");
>   layoutTestController.notifyDone();
> }
>
> layoutTestController.waitUntilDone();
> setTimeout(doTest, 0);
> </script>
> </svg>
>
> The document was laid out and painted once before the timeout fired. Most
> SVG repainting tests work this way: setup document initially, then use a
> setTimeout(doSomething, 0) to eg. change an attribute, then dump the
> document to capture that invalidations/repaints work properly.
>

That's racy and doesn't match what actual browsers will do.

>
> Something has changed recently - to get the same effect as we used to,
> following is needed:
> <script>
> function doTest() {
>   setTimeout(function() {    // EXTRA TIMEOUT 1
>       document.getElementById("rect").setAttribute("width", "100");
>       setTimeout(function() { layoutTestController.notifyDone(); }, 0); //
> EXTRA TIMEOUT 2
>   }, 0);
> }
>
> layoutTestController.waitUntilDone();
> setTimeout(doTest, 0);
> </script>
>

This doesn't look any better.

If you want to paint at a specific time in a repaint test, use
layoutTestController.display().


>
> Does that ring a bell to anyone? Why is the initial painting not done yet,
> if setTimeout(, 0) fires the first time?
> There's also an extra setTimeout needed now, before calling notifyDone(),
> otherwise the repaint is not captured.
>
> Currently most SVG tests that exercise dynamic updates are useless, as the
> painting always happens after the whole script ran, that means it's not
> possible to capture repaint problems at the moment w/o fixing all these
> tests.
>

I think you should fix the tests.

- James


>
> Cheers,
> Niko
>
>
> _______________________________________________
> 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/20120130/512e6452/attachment.html>


More information about the webkit-dev mailing list