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

Unified Diff: Source/core/loader/ImageLoader.cpp

Issue 20473002: Update RenderImage when the image src is cleared (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
Index: Source/core/loader/ImageLoader.cpp
diff --git a/Source/core/loader/ImageLoader.cpp b/Source/core/loader/ImageLoader.cpp
index 9fbabee79622c331ba92247f7abdc00eb8968b9a..7b4b69f062121aa0024d3681f8a92443620f36ac 100644
--- a/Source/core/loader/ImageLoader.cpp
+++ b/Source/core/loader/ImageLoader.cpp
@@ -149,7 +149,7 @@ void ImageLoader::updateFromElement()
AtomicString attr = m_element->imageSourceURL();
- if (attr == m_failedLoadURL)
+ if (!m_failedLoadURL.isEmpty() && attr == m_failedLoadURL)
return;
// Do not load any image if the 'src' attribute is missing or if it is
@@ -216,7 +216,7 @@ void ImageLoader::updateFromElement()
m_hasPendingLoadEvent = newImage;
m_imageComplete = !newImage;
- if (newImage) {
+ if (m_image.get()) {
Nate Chapin 2013/07/25 21:00:31 Aren't m_image and newImage the same thing here? W
if (!m_element->document()->isImageDocument()) {
if (!m_element->document()->hasListenerType(Document::BEFORELOAD_LISTENER))
dispatchPendingBeforeLoadEvent();
@@ -228,8 +228,11 @@ void ImageLoader::updateFromElement()
// If newImage is cached, addClient() will result in the load event
// being queued to fire. Ensure this happens after beforeload is
// dispatched.
- newImage->addClient(this);
+ m_image->addClient(this);
+ } else {
+ updateRenderer();
}
+
if (oldImage)
oldImage->removeClient(this);
}

Powered by Google App Engine
This is Rietveld 408576698