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

Unified Diff: Source/core/html/HTMLImageElement.h

Issue 200923002: Post a microtask to load <img> elements. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: all tests fixed Created 6 years, 9 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: Source/core/html/HTMLImageElement.h
diff --git a/Source/core/html/HTMLImageElement.h b/Source/core/html/HTMLImageElement.h
index 5f238cd6619a8ee1a5dc5b95e042cc31e07d70b4..03c3a64f251a3cb1913ca4c8d01f22595c534397 100644
--- a/Source/core/html/HTMLImageElement.h
+++ b/Source/core/html/HTMLImageElement.h
@@ -73,7 +73,7 @@ public:
bool complete() const;
- bool hasPendingActivity() const { return m_imageLoader.hasPendingActivity(); }
+ bool hasPendingActivity() const { return m_imageLoader.hasPendingActivity() || hasPendingUpdate(); }
virtual bool canContainRangeEndPoint() const OVERRIDE { return false; }
@@ -123,6 +123,16 @@ private:
void resetFormOwner();
+ enum PendingUpdateType {
+ PendingUpdateNone,
+ PendingUpdateIgnoreError,
+ PendingUpdateNormal
+ };
+ void enqueueUpdate(PendingUpdateType);
+ bool hasPendingUpdate() const { return m_pendingUpdate != PendingUpdateNone; }
+ void cancelPendingUpdate();
+ static void processUpdateFromElementQueue();
+
HTMLImageLoader m_imageLoader;
// m_form should be a strong reference in Oilpan.
WeakPtr<HTMLFormElement> m_form;
@@ -130,6 +140,8 @@ private:
AtomicString m_bestFitImageURL;
float m_imageDevicePixelRatio;
bool m_formWasSetByParser;
+
+ PendingUpdateType m_pendingUpdate;
};
} //namespace

Powered by Google App Engine
This is Rietveld 408576698