If the background image of the <body> elements is a large image, it is going to be asynchronously decoded. The problem in this case is, this background image is drawn by the renderer of the <html> element. When requesting the image for decoding, so we add the <html> element renderer to the CachedImage::m_pendingImageDrawingClients even though it's not one of its clients. When the image finishes decoding and CachedImage::imageFrameAvailable() is called, we don't find the renderer of the <html> element in m_clients. So we skip repainting the renderer of the <body> element.
Created attachment 315134 [details] Patch
<rdar://problem/33219746>
An example of this is the background image in http://browserbench.org/JetStream/
Comment on attachment 315134 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=315134&action=review > Source/WebCore/loader/cache/CachedImage.cpp:151 > + // The <html> element draws the background image of the <body> element. The <body> > + // element is a client to this CachedImage but the <html> element is not. In this > + // case add all the CachedImage's clients and cancel the repaint optimization we > + // do in CachedImage::imageFrameAvailable(). This comment isn't accurate. The <body> background only propagates to the root if the <html> does not have its own background specified. See RenderView::rendererForRootBackground() and code in RenderBox::repaintLayerRectsForImage, and elsewhere.
Created attachment 315144 [details] Patch
Comment on attachment 315144 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=315144&action=review > Source/WebCore/loader/cache/CachedImage.cpp:154 > + CachedResourceClientWalker<CachedImageClient> w(m_clients); w -> walker > Source/WebCore/loader/cache/CachedImage.cpp:155 > + while (CachedImageClient* c = w.next()) while (auto* client = walker.next())
Created attachment 315161 [details] Patch
Comment on attachment 315161 [details] Patch Clearing flags on attachment: 315161 Committed r219364: <http://trac.webkit.org/changeset/219364>
All reviewed patches have been landed. Closing bug.
Comment on attachment 315161 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=315161&action=review > Source/WebCore/loader/cache/CachedImage.cpp:148 > + // If the <html> element does not have its own background sepecfied, painting the root box "sepecfied"