From 6755548267d72d8f9d7dbc0a2f68f1297d29f0c2 Mon Sep 17 00:00:00 2001 From: Oriol Brufau Date: Sun, 18 Jun 2023 14:26:10 +0200 Subject: [PATCH] Further changes required by Servo --- components/atoms/static_atoms.txt | 1 + components/style/custom_properties.rs | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/components/atoms/static_atoms.txt b/components/atoms/static_atoms.txt index 7e4f385169e..c7513660cfe 100644 --- a/components/atoms/static_atoms.txt +++ b/components/atoms/static_atoms.txt @@ -1,3 +1,4 @@ +-moz-content-preferred-color-scheme -moz-gtk-csd-close-button-position -moz-gtk-csd-maximize-button-position -moz-gtk-csd-menu-radius diff --git a/components/style/custom_properties.rs b/components/style/custom_properties.rs index 2efcda9ef15..054e5a17c74 100644 --- a/components/style/custom_properties.rs +++ b/components/style/custom_properties.rs @@ -64,6 +64,7 @@ fn get_safearea_inset_right(device: &Device) -> VariableValue { VariableValue::pixels(device.safe_area_insets().right) } +#[cfg(feature = "gecko")] fn get_content_preferred_color_scheme(device: &Device) -> VariableValue { use crate::gecko::media_features::PrefersColorScheme; let prefers_color_scheme = unsafe { @@ -78,6 +79,12 @@ fn get_content_preferred_color_scheme(device: &Device) -> VariableValue { }) } +#[cfg(feature = "servo")] +fn get_content_preferred_color_scheme(_device: &Device) -> VariableValue { + // TODO: implement this. + VariableValue::ident("light") +} + static ENVIRONMENT_VARIABLES: [EnvironmentVariable; 4] = [ make_variable!(atom!("safe-area-inset-top"), get_safearea_inset_top), make_variable!(atom!("safe-area-inset-bottom"), get_safearea_inset_bottom),