Changeset 219364 in webkit


Ignore:
Timestamp:
Jul 11, 2017 2:33:19 PM (7 years ago)
Author:
commit-queue@webkit.org
Message:

REGRESSION(r219045): The <body> element does not get repainted when its background image finishes decoding
https://bugs.webkit.org/show_bug.cgi?id=174376

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-07-11
Reviewed by Simon Fraser.

Source/WebCore:

When adding a CachedImageClient to CachedImage::m_pendingImageDrawingClients
and the CachedImageClient is not one of the CachedImage::m_clients, we
should cancel the repaint optimization in CachedImage::imageFrameAvailable().
This can be done by adding all the CachedImage::m_clients to CachedImage::
m_pendingImageDrawingClients.

Test: fast/images/async-image-body-background-image.html

  • loader/cache/CachedImage.cpp:

(WebCore::CachedImage::addPendingImageDrawingClient):

LayoutTests:

  • fast/images/async-image-body-background-image-expected.html: Added.
  • fast/images/async-image-body-background-image.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r219362 r219364  
     12017-07-11  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        REGRESSION(r219045): The <body> element does not get repainted when its background image finishes decoding
     4        https://bugs.webkit.org/show_bug.cgi?id=174376
     5
     6        Reviewed by Simon Fraser.
     7
     8        * fast/images/async-image-body-background-image-expected.html: Added.
     9        * fast/images/async-image-body-background-image.html: Added.
     10
    1112017-07-11  Youenn Fablet  <youenn@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r219363 r219364  
     12017-07-11  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        REGRESSION(r219045): The <body> element does not get repainted when its background image finishes decoding
     4        https://bugs.webkit.org/show_bug.cgi?id=174376
     5
     6        Reviewed by Simon Fraser.
     7
     8        When adding a CachedImageClient to CachedImage::m_pendingImageDrawingClients
     9        and the CachedImageClient is not one of the CachedImage::m_clients, we
     10        should cancel the repaint optimization in CachedImage::imageFrameAvailable().
     11        This can be done by adding all the CachedImage::m_clients to CachedImage::
     12        m_pendingImageDrawingClients.
     13
     14        Test: fast/images/async-image-body-background-image.html
     15
     16        * loader/cache/CachedImage.cpp:
     17        (WebCore::CachedImage::addPendingImageDrawingClient):
     18
    1192017-07-11  Chris Dumez  <cdumez@apple.com>
    220
  • trunk/Source/WebCore/loader/cache/CachedImage.cpp

    r219045 r219364  
    143143{
    144144    ASSERT(client.resourceClientType() == CachedImageClient::expectedType());
    145     m_pendingImageDrawingClients.add(&client);
     145    if (m_pendingImageDrawingClients.contains(&client))
     146        return;
     147    if (!m_clients.contains(&client)) {
     148        // If the <html> element does not have its own background sepecfied, painting the root box
     149        // renderer uses the style of the <body> element, see RenderView::rendererForRootBackground().
     150        // In this case, the client we are asked to add is the root box renderer. Since we can't add
     151        // a client to m_pendingImageDrawingClients unless it is one of the m_clients, we are going
     152        // to cancel the repaint optimization we do in CachedImage::imageFrameAvailable() by adding
     153        // all the m_clients to m_pendingImageDrawingClients.
     154        CachedResourceClientWalker<CachedImageClient> walker(m_clients);
     155        while (auto* client = walker.next())
     156            m_pendingImageDrawingClients.add(client);
     157    } else
     158        m_pendingImageDrawingClients.add(&client);
    146159}
    147160
Note: See TracChangeset for help on using the changeset viewer.