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

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

Issue 481753002: Use Shadow DOM to display fallback content for images (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 6 years, 3 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 18e1b17652f88462f426e2960891bc1d4075a005..f9ffd4c1efc167515f9ec3887ce9427738b4b261 100644
--- a/Source/core/loader/ImageLoader.cpp
+++ b/Source/core/loader/ImageLoader.cpp
@@ -267,8 +267,11 @@ void ImageLoader::doUpdateFromElement(BypassMainWorldBehavior bypassBehavior, Up
// Fire an error event if the url string is not empty, but the KURL is.
m_hasPendingErrorEvent = true;
errorEventSender().dispatchEventSoon(this);
+ } else {
+ noImageResourceToLoad();
}
+
ImageResource* oldImage = m_image.get();
if (newImage != oldImage) {
sourceImageChanged();
@@ -329,7 +332,7 @@ void ImageLoader::updateFromElement(UpdateFromElementBehavior updateBehavior, Lo
}
KURL url = imageSourceToKURL(imageSourceURL);
- if (imageSourceURL.isNull() || url.isNull() || shouldLoadImmediately(url, loadType)) {
+ if ((!imageSourceURL.isNull() && url.isNull()) || shouldLoadImmediately(url, loadType)) {
esprehn 2014/09/05 00:47:52 Why did you change this?
rhogan 2014/09/08 19:52:42 This allows images with no src="" to go through th
doUpdateFromElement(DoNotBypassMainWorldCSP, updateBehavior);
return;
}
@@ -359,7 +362,8 @@ bool ImageLoader::shouldLoadImmediately(const KURL& url, LoadType loadType) cons
|| isHTMLObjectElement(m_element)
|| isHTMLEmbedElement(m_element)
|| url.protocolIsData()
- || memoryCache()->resourceForURL(url)
+ || !element()->document().frame()
esprehn 2014/09/05 00:47:52 What are you checking here? I think you mean docum
rhogan 2014/09/08 19:52:43 When creating the MicroTask there's an ASSERT(load
+ || (!url.isNull() && memoryCache()->resourceForURL(url))
|| loadType == ForceLoadImmediately);
}

Powered by Google App Engine
This is Rietveld 408576698