summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/core/loader/image_loader.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/blink/renderer/core/loader/image_loader.h')
-rw-r--r--chromium/third_party/blink/renderer/core/loader/image_loader.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/chromium/third_party/blink/renderer/core/loader/image_loader.h b/chromium/third_party/blink/renderer/core/loader/image_loader.h
index 181069a59f9..a2c3147fbc0 100644
--- a/chromium/third_party/blink/renderer/core/loader/image_loader.h
+++ b/chromium/third_party/blink/renderer/core/loader/image_loader.h
@@ -160,20 +160,17 @@ class CORE_EXPORT ImageLoader : public GarbageCollected<ImageLoader>,
enum class LazyImageLoadState {
kNone, // LazyImages not active.
kDeferred, // Full image load not started, and image load event will not be
- // fired. If image dimensions is present, document load event
- // will be unblocked. Otherwise placeholder fetch will start,
- // and once its done document load event is unblocked.
+ // fired. Image will not block the document's load event.
kFullImage // Full image is loading/loaded, due to element coming near the
- // viewport or if a placeholder load actually fetched the full
- // image. image_complete_ can differentiate if the fetch is
- // complete or not. After the fetch, image load event is fired.
+ // viewport. image_complete_ can be used to differentiate if the
+ // fetch is complete or not. After the fetch, image load event
+ // is fired.
};
// Called from the task or from updateFromElement to initiate the load.
void DoUpdateFromElement(
BypassMainWorldBehavior,
UpdateFromElementBehavior,
- const KURL&,
network::mojom::ReferrerPolicy = network::mojom::ReferrerPolicy::kDefault,
UpdateType = UpdateType::kAsync);
@@ -197,8 +194,7 @@ class CORE_EXPORT ImageLoader : public GarbageCollected<ImageLoader>,
void ClearFailedLoadURL();
void DispatchErrorEvent();
void CrossSiteOrCSPViolationOccurred(AtomicString);
- void EnqueueImageLoadingMicroTask(const KURL&,
- UpdateFromElementBehavior,
+ void EnqueueImageLoadingMicroTask(UpdateFromElementBehavior,
network::mojom::ReferrerPolicy);
KURL ImageSourceToKURL(AtomicString) const;
@@ -252,7 +248,12 @@ class CORE_EXPORT ImageLoader : public GarbageCollected<ImageLoader>,
bool image_complete_ : 1;
bool suppress_error_events_ : 1;
- bool was_fully_deferred_ : 1; // Used by LazyImageLoad.
+ // Tracks whether or not an image whose load was deferred was explicitly lazy
+ // (i.e., had developer-supplied `loading=lazy`). This matters because images
+ // that were not explicitly lazy but were deferred via automatic lazy image
+ // loading should continue to block the window load event, whereas explicitly
+ // lazy images should never block the window load event.
+ bool was_deferred_explicitly_ : 1;
LazyImageLoadState lazy_image_load_state_;