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

Unified Diff: third_party/WebKit/Source/core/html/HTMLImageElement.cpp

Issue 2371643002: HTMLImageElement: do not use fallback content for ImageDocument (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2840
Patch Set: Created 4 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: 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();

Powered by Google App Engine
This is Rietveld 408576698