Chromium Code Reviews| 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); |
| } |