diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
commit | def92d1b8e9d373e2f6f27c366d578d97d8960c6 (patch) | |
tree | 2ef34b9ad8bb9a9220e05d60352558b15f513894 /layout/style/nsMediaFeatures.cpp | |
parent | Adding debian version 125.0.3-1. (diff) | |
download | firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.tar.xz firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/style/nsMediaFeatures.cpp')
-rw-r--r-- | layout/style/nsMediaFeatures.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/layout/style/nsMediaFeatures.cpp b/layout/style/nsMediaFeatures.cpp index f888c127d4..fbdde4102d 100644 --- a/layout/style/nsMediaFeatures.cpp +++ b/layout/style/nsMediaFeatures.cpp @@ -336,18 +336,20 @@ StyleDynamicRange Gecko_MediaFeatures_DynamicRange(const Document* aDocument) { StyleDynamicRange Gecko_MediaFeatures_VideoDynamicRange( const Document* aDocument) { - if (aDocument->ShouldResistFingerprinting(RFPTarget::CSSVideoDynamicRange)) { + if (aDocument->ShouldResistFingerprinting(RFPTarget::CSSVideoDynamicRange) || + !StaticPrefs::layout_css_video_dynamic_range_allows_high()) { return StyleDynamicRange::Standard; } // video-dynamic-range: high has 3 requirements: // 1) high peak brightness // 2) high contrast ratio // 3) color depth > 24 - // We check the color depth requirement before asking the LookAndFeel - // if it is HDR capable. + + // As a proxy for those requirements, return 'High' if the screen associated + // with the device context claims to be HDR capable. if (nsDeviceContext* dx = GetDeviceContextFor(aDocument)) { - if (dx->GetDepth() > 24 && - LookAndFeel::GetInt(LookAndFeel::IntID::VideoDynamicRange)) { + if (dx->GetScreenIsHDR()) { + // bjw return StyleDynamicRange::High; } } |