summaryrefslogtreecommitdiffstats
path: root/layout/style/nsMediaFeatures.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /layout/style/nsMediaFeatures.cpp
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz
firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.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.cpp12
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;
}
}