RESOLVED FIXED 174376
REGRESSION(r219045): The <body> element does not get repainted when its background image finishes decoding
https://bugs.webkit.org/show_bug.cgi?id=174376
Summary REGRESSION(r219045): The <body> element does not get repainted when its backg...
Said Abou-Hallawa
Reported 2017-07-11 11:21:06 PDT
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.
Attachments
Patch (5.79 KB, patch)
2017-07-11 11:27 PDT, Said Abou-Hallawa
no flags
Patch (6.03 KB, patch)
2017-07-11 12:39 PDT, Said Abou-Hallawa
no flags
Patch (5.98 KB, patch)
2017-07-11 13:52 PDT, Said Abou-Hallawa
no flags
Said Abou-Hallawa
Comment 1 2017-07-11 11:27:56 PDT
Said Abou-Hallawa
Comment 2 2017-07-11 11:30:25 PDT
Said Abou-Hallawa
Comment 3 2017-07-11 11:31:29 PDT
An example of this is the background image in http://browserbench.org/JetStream/
Simon Fraser (smfr)
Comment 4 2017-07-11 11:46:57 PDT
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.
Said Abou-Hallawa
Comment 5 2017-07-11 12:39:59 PDT
Simon Fraser (smfr)
Comment 6 2017-07-11 12:58:13 PDT
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())
Said Abou-Hallawa
Comment 7 2017-07-11 13:52:49 PDT
WebKit Commit Bot
Comment 8 2017-07-11 14:33:22 PDT
Comment on attachment 315161 [details] Patch Clearing flags on attachment: 315161 Committed r219364: <http://trac.webkit.org/changeset/219364>
WebKit Commit Bot
Comment 9 2017-07-11 14:33:24 PDT
All reviewed patches have been landed. Closing bug.
Darin Adler
Comment 10 2017-07-11 21:27:00 PDT
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"
Note You need to log in before you can comment on or make changes to this bug.