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

Unified Diff: Source/core/rendering/RenderImage.cpp

Issue 20473002: Update RenderImage when the image src is cleared (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Re-baselined one of the expected test result Created 7 years, 5 months 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 | « Source/core/loader/ImageLoader.cpp ('k') | Source/core/rendering/RenderImageResource.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderImage.cpp
diff --git a/Source/core/rendering/RenderImage.cpp b/Source/core/rendering/RenderImage.cpp
index 81799184d4c68016008e3c5cc3e5ffe7b919a00f..9c17c6ee3919623cfe2e2d632887dde0b267930a 100644
--- a/Source/core/rendering/RenderImage.cpp
+++ b/Source/core/rendering/RenderImage.cpp
@@ -159,7 +159,7 @@ void RenderImage::imageChanged(WrappedImagePtr newImage, const IntRect* rect)
if (!m_imageResource)
return;
- if (newImage != m_imageResource->imagePtr() || !newImage)
+ if (newImage != m_imageResource->imagePtr())
return;
if (!m_didIncrementVisuallyNonEmptyPixelCount) {
@@ -171,7 +171,7 @@ void RenderImage::imageChanged(WrappedImagePtr newImage, const IntRect* rect)
bool imageSizeChanged = false;
// Set image dimensions, taking into account the size of the alt text.
- if (m_imageResource->errorOccurred()) {
+ if (m_imageResource->errorOccurred() || !newImage) {
if (!m_altText.isEmpty() && document()->hasPendingStyleRecalc()) {
ASSERT(node());
if (node()) {
@@ -190,7 +190,7 @@ bool RenderImage::updateIntrinsicSizeIfNeeded(const LayoutSize& newSize, bool im
{
if (newSize == intrinsicSize() && !imageSizeChanged)
return false;
- if (m_imageResource->errorOccurred())
+ if (m_imageResource->errorOccurred() || !m_imageResource->hasImage())
spartha 2013/07/31 09:58:07 This change was missed as the test case was defici
return imageSizeChanged;
setIntrinsicSize(newSize);
return true;
« no previous file with comments | « Source/core/loader/ImageLoader.cpp ('k') | Source/core/rendering/RenderImageResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698