Index: Source/WebCore/css/CSSCrossfadeValue.cpp |
=================================================================== |
--- Source/WebCore/css/CSSCrossfadeValue.cpp (revision 137663) |
+++ Source/WebCore/css/CSSCrossfadeValue.cpp (working copy) |
@@ -128,14 +128,26 @@ |
void CSSCrossfadeValue::loadSubimages(CachedResourceLoader* cachedResourceLoader) |
{ |
+ CachedResourceHandle<CachedImage> oldCachedFromImage = m_cachedFromImage; |
+ CachedResourceHandle<CachedImage> oldCachedToImage = m_cachedToImage; |
+ |
m_cachedFromImage = cachedImageForCSSValue(m_fromValue.get(), cachedResourceLoader); |
m_cachedToImage = cachedImageForCSSValue(m_toValue.get(), cachedResourceLoader); |
- if (m_cachedFromImage) |
- m_cachedFromImage->addClient(&m_crossfadeSubimageObserver); |
- if (m_cachedToImage) |
- m_cachedToImage->addClient(&m_crossfadeSubimageObserver); |
+ if (m_cachedFromImage != oldCachedFromImage) { |
+ if (oldCachedFromImage) |
+ oldCachedFromImage->removeClient(&m_crossfadeSubimageObserver); |
+ if (m_cachedFromImage) |
+ m_cachedFromImage->addClient(&m_crossfadeSubimageObserver); |
+ } |
+ if (m_cachedToImage != oldCachedToImage) { |
+ if (oldCachedToImage) |
+ oldCachedToImage->removeClient(&m_crossfadeSubimageObserver); |
+ if (m_cachedToImage) |
+ m_cachedToImage->addClient(&m_crossfadeSubimageObserver); |
+ } |
+ |
m_crossfadeSubimageObserver.setReady(true); |
} |