Index: Source/core/html/HTMLImageElement.cpp |
diff --git a/Source/core/html/HTMLImageElement.cpp b/Source/core/html/HTMLImageElement.cpp |
index e96f979fa7d6d19845908b8932b4e39f0182ed6b..2303be26fa356cd392a94ab2186aed9f010547e1 100644 |
--- a/Source/core/html/HTMLImageElement.cpp |
+++ b/Source/core/html/HTMLImageElement.cpp |
@@ -165,12 +165,14 @@ void HTMLImageElement::attach(const AttachContext& context) |
RenderImageResource* renderImageResource = renderImage->imageResource(); |
if (renderImageResource->hasImage()) |
return; |
- renderImageResource->setCachedImage(m_imageLoader.image()); |
// If we have no image at all because we have no src attribute, set |
// image height and width for the alt text instead. |
if (!m_imageLoader.image() && !renderImageResource->cachedImage()) |
renderImage->setImageSizeForAltText(); |
+ else |
+ renderImageResource->setCachedImage(m_imageLoader.image()); |
+ |
} |
} |