Revert "Backport several style changes from Gecko (5) (#30099)" (#30104)

This reverts commit 8e15389cae.
This commit is contained in:
Oriol Brufau 2023-08-16 08:24:42 +02:00 committed by GitHub
parent 8e15389cae
commit d6ae8dc112
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
152 changed files with 4622 additions and 5862 deletions

View file

@ -64,27 +64,6 @@ 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 {
crate::gecko_bindings::bindings::Gecko_MediaFeatures_PrefersColorScheme(
device.document(),
/* use_content = */ true,
)
};
VariableValue::ident(match prefers_color_scheme {
PrefersColorScheme::Light => "light",
PrefersColorScheme::Dark => "dark",
})
}
#[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),
@ -120,7 +99,7 @@ macro_rules! lnf_int_variable {
}};
}
static CHROME_ENVIRONMENT_VARIABLES: [EnvironmentVariable; 6] = [
static CHROME_ENVIRONMENT_VARIABLES: [EnvironmentVariable; 5] = [
lnf_int_variable!(
atom!("-moz-gtk-csd-titlebar-radius"),
TitlebarRadius,
@ -142,7 +121,6 @@ static CHROME_ENVIRONMENT_VARIABLES: [EnvironmentVariable; 6] = [
GTKCSDMaximizeButtonPosition,
integer
),
make_variable!(atom!("-moz-content-preferred-color-scheme"), get_content_preferred_color_scheme),
];
impl CssEnvironment {
@ -350,11 +328,6 @@ impl VariableValue {
})
}
/// Create VariableValue from an int.
fn ident(ident: &'static str) -> Self {
Self::from_token(Token::Ident(ident.into()))
}
/// Create VariableValue from a float amount of CSS pixels.
fn pixels(number: f32) -> Self {
// FIXME (https://github.com/servo/rust-cssparser/issues/266):