Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Unified Diff: Source/WebCore/css/CSSCrossfadeValue.cpp

Issue 11573024: Merge 136558 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1312/
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/images/crossfade-client-not-removed-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « LayoutTests/fast/images/crossfade-client-not-removed-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698