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

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

Issue 2364073002: Reland of HTMLImageElement: do not use fallback content for ImageDocument (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 757fddb552d961d1f901387ef0d909c8f8dd3796..04344634724ef3ca6679324c4da7800f0535c088 100644
--- a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
@@ -733,6 +733,7 @@
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
@@ -746,7 +747,7 @@
// 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