Index: third_party/WebKit/Source/core/html/HTMLImageElement.cpp |
diff --git a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp |
index 6689203f3cca345dfef15e3e284c8b23cc531d60..c245419642c7819b2707366dc29466d82b173e3c 100644 |
--- a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp |
+++ b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp |
@@ -720,6 +720,7 @@ void HTMLImageElement::selectSourceURL(ImageLoader::UpdateFromElementBehavior be |
bool imageHasLoaded = imageLoader().image() && !imageLoader().image()->isLoading() && !imageLoader().image()->errorOccurred(); |
bool imageStillLoading = !imageHasLoaded && imageLoader().hasPendingActivity() && !imageLoader().hasPendingError() && !imageSourceURL().isEmpty(); |
bool imageHasImage = imageLoader().image() && imageLoader().image()->hasImage(); |
+ bool imageIsDocument = imageLoader().isLoadingImageDocument() && imageLoader().image() && !imageLoader().image()->errorOccurred(); |
// Icky special case for deferred images: |
// A deferred image is not loading, does have pending activity, does not |
@@ -733,7 +734,7 @@ void HTMLImageElement::selectSourceURL(ImageLoader::UpdateFromElementBehavior be |
// Instead of dealing with that, there's a separate check that the |
// ImageResource has non-null image data associated with it, which isn't |
// folded into imageHasLoaded above. |
- if ((imageHasLoaded && imageHasImage) || imageStillLoading) |
+ if ((imageHasLoaded && imageHasImage) || imageStillLoading || imageIsDocument) |
ensurePrimaryContent(); |
else |
ensureFallbackContent(); |