Bug 76535 - CSS Shaders: Remove the setTimeout from the layout tests
Summary: CSS Shaders: Remove the setTimeout from the layout tests
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alexandru Chiculita
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-18 05:48 PST by Alexandru Chiculita
Modified: 2012-01-19 15:21 PST (History)
2 users (show)

See Also:


Attachments
Patch V1 (6.76 KB, patch)
2012-01-19 06:37 PST, Alexandru Chiculita
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandru Chiculita 2012-01-18 05:48:13 PST
In the CSS Shaders tests we've used setTimeout to make sure the resources are loaded and the painting is ready. Remove the setTimeout.
Comment 1 Alexandru Chiculita 2012-01-19 03:49:48 PST
We cannot remove the setTimeout, but we can make the setTimeout use a 0 delay.

The problem is that the onload event is triggered before the last resource notifies its clients that it finished. The code is in SubresourceLoader::releaseResources() which calls "m_document->cachedResourceLoader()->loadDone();" before "m_resource->stopLoading();" . "loadDone()" triggers the onload JS event. Even if we do a layout in this event the RenderLayer is not notified yet that the resources are now loaded and ready for paint. The notification will come only after the onload event is triggered, meaning that a simple setTimeout("", 0) will do the trick.
Comment 2 Alexandru Chiculita 2012-01-19 06:37:46 PST
Created attachment 123120 [details]
Patch V1

It was much simpler than I expected. It just needed to call the CachedResource::data in CachedShader::data when the resource was finished. Otherwise the notification was postponed only after the onload event.
Comment 3 WebKit Review Bot 2012-01-19 15:21:09 PST
Comment on attachment 123120 [details]
Patch V1

Clearing flags on attachment: 123120

Committed r105454: <http://trac.webkit.org/changeset/105454>
Comment 4 WebKit Review Bot 2012-01-19 15:21:13 PST
All reviewed patches have been landed.  Closing bug.