<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>288020</bug_id>
          
          <creation_ts>2025-02-19 15:52:56 -0800</creation_ts>
          <short_desc>[HDR] Add test infrastructure to enable HDR images in layout tests</short_desc>
          <delta_ts>2025-02-20 11:56:39 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Images</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>282299</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Said Abou-Hallawa">sabouhallawa</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>sabouhallawa</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2096108</commentid>
    <comment_count>0</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2025-02-19 15:52:56 -0800</bug_when>
    <thetext>Two things will be added to support HDR images in layout tests:

1. An internal API called setHeadroomForTesting() will be added. The inputs are HTMLImageElement and a headroom as a float. This API will will override the image headroom value. So if we want to make an SDR image pretend to be an HDR image, we need to make call like this:

    internals.setHeadroomForTesting(image, 5);

This API will eventually sets an std::optional&lt;Headroom&gt; member in BitmapImageSource. This setting will force the CALayer to be an HDR layer. Plus it will change the display of this image. 

2. To test the display of the HDR image, BitmapImage::draw() will check if setHeadroomForTesting() was called for this image. And if this happened, it will display a golden rectangle regardless of the original contents.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2096109</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2025-02-19 15:53:20 -0800</bug_when>
    <thetext>&lt;rdar://problem/145173897&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2096113</commentid>
    <comment_count>2</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2025-02-19 15:57:14 -0800</bug_when>
    <thetext>https://github.com/WebKit/WebKit/pull/40917</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2096466</commentid>
    <comment_count>3</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2025-02-20 11:56:39 -0800</bug_when>
    <thetext>Committed 290704@main (0f0ff23): https://commits.webkit.org/290704@main</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>