{
}
-PassRefPtr<StyleImage> ElementStyleResources::styleImage(const TextLinkColors& textLinkColors, Color currentColor, CSSPropertyID property, CSSValue* value)
+PassRefPtr<StyleImage> ElementStyleResources::styleImage(Document& document, const TextLinkColors& textLinkColors, Color currentColor, CSSPropertyID property, CSSValue* value)
{
if (value->isImageValue())
- return cachedOrPendingFromValue(property, toCSSImageValue(value));
+ return cachedOrPendingFromValue(document, property, toCSSImageValue(value));
if (value->isImageGeneratorValue()) {
if (value->isGradientValue())
return image.release();
}
-PassRefPtr<StyleImage> ElementStyleResources::cachedOrPendingFromValue(CSSPropertyID property, CSSImageValue* value)
+PassRefPtr<StyleImage> ElementStyleResources::cachedOrPendingFromValue(Document& document, CSSPropertyID property, CSSImageValue* value)
{
RefPtr<StyleImage> image = value->cachedOrPendingImage();
- if (image && image->isPendingImage())
- m_pendingImageProperties.set(property, value);
+ if (image) {
+ if (image->isPendingImage())
+ m_pendingImageProperties.set(property, value);
+ else
+ value->restoreCachedResourceIfNeeded(document);
+ }
return image.release();
}