Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0fee98d9aebfaae332f980001c3325824379474f
      
https://github.com/WebKit/WebKit/commit/0fee98d9aebfaae332f980001c3325824379474f
  Author: Simon Fraser <[email protected]>
  Date:   2025-09-27 (Sat, 27 Sep 2025)

  Changed paths:
    M Source/WebCore/loader/cache/CachedImage.cpp
    M Source/WebCore/loader/cache/CachedImage.h
    M Source/WebCore/platform/graphics/BitmapImage.h
    M Source/WebCore/platform/graphics/GeneratedImage.h
    M Source/WebCore/platform/graphics/Image.h
    M Source/WebCore/platform/graphics/cg/PDFDocumentImage.h
    M Source/WebCore/rendering/RenderImageResource.cpp
    M Source/WebCore/rendering/RenderImageResource.h
    M Source/WebCore/svg/graphics/SVGImage.h
    M Source/WebCore/svg/graphics/SVGImageForContainer.h

  Log Message:
  -----------
  Add a way to know if a CachedImage is showing a complete frame
https://bugs.webkit.org/show_bug.cgi?id=299647
rdar://161453244

Reviewed by Said Abou-Hallawa.

LargestContentfulPaint needs to know if an image is showing a fully-decoded 
frame.
For an animated image, this can mean that the entire image is still downloading
(so we can't check the status()), but if the current frame is complete, we can 
count it for LCP.

For a single-frame image, "complete" is equivalent to the image download being 
complete.

Fix by exposing ImageSource's `currentImageFrame().isComplete()` up through to 
CachedImage,
for bitmap images. For other image types, choose something reasonable.

This will be tested by image-related largest-contentful-paint tests.

* Source/WebCore/loader/cache/CachedImage.cpp:
(WebCore::CachedImage::currentFrameIsComplete):
* Source/WebCore/loader/cache/CachedImage.h:
* Source/WebCore/platform/graphics/BitmapImage.h:
* Source/WebCore/platform/graphics/GeneratedImage.h:
* Source/WebCore/platform/graphics/Image.h:
* Source/WebCore/platform/graphics/cg/PDFDocumentImage.h:
* Source/WebCore/rendering/RenderImageResource.cpp:
(WebCore::RenderImageResource::currentFrameIsComplete const):
* Source/WebCore/rendering/RenderImageResource.h:
* Source/WebCore/svg/graphics/SVGImage.h:
* Source/WebCore/svg/graphics/SVGImageForContainer.h:

Canonical link: https://commits.webkit.org/300641@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to