Open Bug 1727393 Opened 4 years ago Updated 2 years ago

Expose video-color-gamut or video-dynamic-range media queries

Categories

(Core :: CSS Parsing and Computation, enhancement)

enhancement

Tracking

()

People

(Reporter: jrmuizel, Unassigned)

Details

We're planning on supporting HDR for video on macOS. YouTube currently uses the following test to decide whether to serve HDR:
return window.matchMedia('(dynamic-range: high)').matches || (window.screen.pixelDepth > 24 && window.matchMedia('(color-gamut: p3)').matches);

Because we'd only support HDR in video we can't really match either of of the current queries. Media Queries 5 has video-dynamic-range and video-color-gamut which we could match. Would be willing to implement these media queries? How would it be done?

To update, we partially support video-dynamic-range and color-gamut (always reports sRGB?) now, but no browser supports video-color-gamut yet afaik. This bug might be better as being replaced as a separate bug for properly implementing (video)-color-gamut (see also Bug 1771373).

YouTube's check has also been tweaked a bit fwiw:

window.matchMedia("(dynamic-range: high), (video-dynamic-range: high)").matches || 24 < window.screen.pixelDepth && window.matchMedia("(color-gamut: p3)").matches)
You need to log in before you can comment on or make changes to this bug.