[Webkit-unassigned] [Bug 254489] New: window.matchMedia('( dynamic-range: high )').matches does not reflect HDR capability

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Mar 26 16:49:06 PDT 2023


https://bugs.webkit.org/show_bug.cgi?id=254489

            Bug ID: 254489
           Summary: window.matchMedia('( dynamic-range: high )').matches
                    does not reflect HDR capability
           Product: WebKit
           Version: Safari 16
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Images
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: greg323464 at gmail.com
                CC: sabouhallawa at apple.com

The CSS media query and related JS command to query for support of High Dynamic Range (HDR) is returning true when no image can be properly rendered as HDR.

window.matchMedia('( dynamic-range: high )').matches returns true on a computer such as the M1 MacBook Pro.
The CSS media query is similarly affected: @media (dynamic-range: high) { ... }

While such a computer does support high dynamic range, Safari currently does not (support for tone mapping to SDR is coming, but this also does not utilize the HDR capabilities of the monitor: https://bugs.webkit.org/show_bug.cgi?id=245858).

My understanding is that the intent of this media query is to be able to use HDR features, specifically do do things like load an HDR version of a photograph. So reporting true on such a system leads to loading an HDR image which will look clipped or at best tone mapped. Instead, an SDR (standard dynamic range) image such as a JPG is better until Safari is able to render the image as a true HDR. This behavior makes the "( dynamic-range: high )" media query unsuitable for its intended purpose: to be able to create a page which simply and dynamically serves HDR assets when they are useful. 

There is support already in Safari for HDR video and the corresponding "(video-dynamic-range: high)" should be relevant for those needs. Its behavior accurately reflects Safari capabilities as far as I know.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230326/ff5dbabc/attachment.htm>


More information about the webkit-unassigned mailing list