1. We depend on a run loop observer that fires just before CA does painting to ensure that layout is up-to-date. 2. TileController manually calls setNeedsDisplay on CALayers. 3. RenderLayerCompositor can (after r147797) defer #1 and cause it to not happen in the same run loop cycle as #2. 4. This means that we can end up painting without layout being up-to-date, which can cause horrible, horrible graphical issues. We need to not defer (#3) if TileController has setNeedsDisplay'd any layers manually (or if we've added any new dirty layers). <rdar://problem/14286329>
One of the best repro cases of actual real world badness caused by this is http://www.mercurynews.com, which frequently shows garbage (or black) upon loading.
#2 is actually "TileController can parent layers which had setNeedsDisplay called on them long ago, but were unparented"
Created attachment 206378 [details] preliminary patch
Created attachment 206409 [details] patch
Comment on attachment 206409 [details] patch For the benefit of future debuggers, it might be good to add a comment above platformCALayerDidCreateTiles call as it is not that obvious that it initiates an immediate layer flush.
(In reply to comment #5) > (From update of attachment 206409 [details]) > For the benefit of future debuggers, it might be good to add a comment above platformCALayerDidCreateTiles call as it is not that obvious that it initiates an immediate layer flush. True. I'll do that.
http://trac.webkit.org/changeset/152548