Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1915654207cc87c4ca36fb433b5a6b41536b9982
      
https://github.com/WebKit/WebKit/commit/1915654207cc87c4ca36fb433b5a6b41536b9982
  Author: Simon Fraser <[email protected]>
  Date:   2025-06-17 (Tue, 17 Jun 2025)

  Changed paths:
    M LayoutTests/TestExpectations
    A LayoutTests/compositing/hdr/iframe-with-hdr-image-expected.txt
    A LayoutTests/compositing/hdr/iframe-with-hdr-image.html
    M LayoutTests/platform/ios/TestExpectations
    M LayoutTests/platform/mac-wk2/TestExpectations
    M Source/WebCore/dom/Document.cpp
    M Source/WebCore/dom/Document.h
    M Source/WebCore/html/HTMLCanvasElement.cpp
    M Source/WebCore/platform/graphics/BitmapImage.h
    M Source/WebCore/platform/graphics/BitmapImageSource.cpp
    M Source/WebCore/platform/graphics/BitmapImageSource.h
    M Source/WebCore/rendering/RenderLayerCompositor.cpp

  Log Message:
  -----------
  [HDR] Images inside an iframe will not be detected for HDRness unless the 
iframe is composited
https://bugs.webkit.org/show_bug.cgi?id=292947
rdar://151245454

Reviewed by Said Abou-Hallawa.

When an iframe is not composited for other reasons (i.e. not scrollable, and not
site-isolated), we don't detect that there are HDR images in the content, so 
don't
promote layers to HDR layers. This is because the iframe document itself is not
composited, so we don't run the HDR image detection code in RenderLayerBacking.

Fix by making an iframe use content compositing layers if we detect that is
has HDR content, as we do for scrollability in
`RenderLayerCompositor::cacheAcceleratedCompositingFlagsAfterLayout()`.

To make testing easier, ensure that calling 
`internals.setHasHDRContentForTesting()`
on an image after it loads triggers a `imageContentChanged` call via a change
in BitmapImageSource. This will trigger the logic that reevaluates compositing.

* LayoutTests/TestExpectations: Just skip the entire directory.
* LayoutTests/compositing/hdr/iframe-with-hdr-image-expected.txt: Added.
* LayoutTests/compositing/hdr/iframe-with-hdr-image.html: Added.
* LayoutTests/platform/ios/TestExpectations:
* LayoutTests/platform/mac-wk2/TestExpectations:
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::setHasHDRContent):
* Source/WebCore/dom/Document.h:
(WebCore::Document::setHasHDRContent): Deleted.
 Source/WebCore/html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::createContext2d): Safer-cpp fix
* Source/WebCore/platform/graphics/BitmapImage.h: Make 
hasHDRContentForTesting() private.
* Source/WebCore/platform/graphics/BitmapImageSource.cpp:
(WebCore::BitmapImageSource::setHasHDRContentForTesting):
* Source/WebCore/platform/graphics/BitmapImageSource.h:
* Source/WebCore/rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlagsAfterLayout):

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