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

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

Issue 2247073006: Add loadend event when finishing loading image Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/loader/ImageLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/ImageLoader.cpp b/third_party/WebKit/Source/core/loader/ImageLoader.cpp
index 86f65618292a28c53500d98bb06686c25897ba40..47836a690c392217dc1b0c2f1074abad05fff3d1 100644
--- a/third_party/WebKit/Source/core/loader/ImageLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/ImageLoader.cpp
@@ -547,12 +547,13 @@ void ImageLoader::timerFired(TimerBase*)
void ImageLoader::dispatchPendingEvent(ImageEventSender* eventSender)
{
RESOURCE_LOADING_DVLOG(1) << "ImageLoader::dispatchPendingEvent " << this;
- ASSERT(eventSender == &loadEventSender() || eventSender == &errorEventSender());
const AtomicString& eventType = eventSender->eventType();
if (eventType == EventTypeNames::load)
dispatchPendingLoadEvent();
if (eventType == EventTypeNames::error)
dispatchPendingErrorEvent();
+ if (eventType == EventTypeNames::loadend)
+ dispatchPendingLoadendEvent();
}
void ImageLoader::dispatchPendingLoadEvent()
@@ -584,6 +585,15 @@ void ImageLoader::dispatchPendingErrorEvent()
updatedHasPendingEvent();
}
+void ImageLoader::dispatchPendingLoadendEvent()
+{
+ if (element()->document().frame()) {
+ dispatchLoadendEvent();
+ }
+
+ updatedHasPendingEvent();
+}
+
bool ImageLoader::getImageAnimationPolicy(ImageAnimationPolicy& policy)
{
if (!element()->document().settings())

Powered by Google App Engine
This is Rietveld 408576698