2012-02-17 Nate Chapin <japhet@chromium.org>
authorjaphet@chromium.org <japhet@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Feb 2012 19:45:14 +0000 (19:45 +0000)
committerjaphet@chromium.org <japhet@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Feb 2012 19:45:14 +0000 (19:45 +0000)
commit7cfa204e99f5ce44aaffab0a8879372408fce7e7
tree3eb26e1ac77d188d7d43db1a3952f378a13225c3
parent55d1e1b70d3e6c27ba318ab7d3e58ebb0110ec37
2012-02-17  Nate Chapin  <japhet@chromium.org>

        [Chromium mac] Cursors and background images disappear.
        https://bugs.webkit.org/show_bug.cgi?id=78834

        The issue occurs because a CachedImage sees that it has no clients
        and decide it is safe to purge its m_data buffer. However,
        StyleCachedImage is holding a CachedResourceHandle to the
        CachedImage, and it can still add a client later. If it does so,
        the CachedImage says everything is loaded but has no data.

        Reviewed by Adam Barth.

        No new tests, since the known repros have resisted reduction.
        Tested manually with chrome.angrybirds.com, redfin.com and a
        couple of other sites.

        * rendering/style/StyleCachedImage.cpp:
        * rendering/style/StyleCachedImage.h: Ensure the underlying
            CachedImage has a client for the lifetime of the
            StyleCachedImage and doesn't purge its buffer. Call
            addClient(this) in the constructor and removeClient(this) in
            the destructor, then ignore all cache callbacks.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108100 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/rendering/style/StyleCachedImage.cpp
Source/WebCore/rendering/style/StyleCachedImage.h