Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 55423322fb8348f488e1c3f39cb00af4a5610951
      
https://github.com/WebKit/WebKit/commit/55423322fb8348f488e1c3f39cb00af4a5610951
  Author: Simon Fraser <[email protected]>
  Date:   2025-09-28 (Sun, 28 Sep 2025)

  Changed paths:
    A 
LayoutTests/performance-api/paint-timing/contentful-with-background-image-expected.txt
    A 
LayoutTests/performance-api/paint-timing/contentful-with-background-image.html
    M Source/WebCore/rendering/RenderBox.cpp

  Log Message:
  -----------
  An element with a background image does not always count as contentful to 
paint-timing
https://bugs.webkit.org/show_bug.cgi?id=299650
rdar://161456094

Reviewed by Alan Baradlay.

`RenderBox::imageChanged()` has an early return when `!isComposited()`, which 
comes before
the call to `incrementVisuallyNonEmptyPixelCountIfNeeded()`, so a document with 
only an
element with a background image will never become contentful, and we'll never 
make a paint timing
entry.

Fix by calling `incrementVisuallyNonEmptyPixelCountIfNeeded()` before the early 
return.

A failure on `paint-timing/fcp-only/fcp-whitespace.html` then revealed that 
we're allowing
a zero-sized background image to contribute to visually non-empty, so add some 
code to check
for a non-zero background size. This isn't ideal; paint-timing really needs to 
use the same
paint-time hook as largest-contentful-paint, which gets the actual rectangle.

Test: performance-api/paint-timing/contentful-with-background-image.html

* 
LayoutTests/performance-api/paint-timing/contentful-with-background-image-expected.txt:
 Added.
* 
LayoutTests/performance-api/paint-timing/contentful-with-background-image.html: 
Added.
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::findLayerUsedImage):
(WebCore::RenderBox::imageChanged):

Canonical link: https://commits.webkit.org/300667@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