From 0f512b4432f08e3b31be59a3147e7c6a5655a032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Mon, 4 Nov 2019 13:34:18 +0100 Subject: [PATCH] style: Fix Servo build. --- .../style/media_queries/media_feature_expression.rs | 8 ++++++-- components/style/properties/properties.mako.rs | 11 +++++++---- components/style/values/computed/length.rs | 1 - 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/components/style/media_queries/media_feature_expression.rs b/components/style/media_queries/media_feature_expression.rs index 6323a8254611..4704fab0ffc1 100644 --- a/components/style/media_queries/media_feature_expression.rs +++ b/components/style/media_queries/media_feature_expression.rs @@ -242,9 +242,13 @@ fn consume_operation_or_colon(input: &mut Parser) -> Result, () })) } +#[allow(unused_variables)] fn disabled_by_pref(feature: &Atom) -> bool { - if *feature == atom!("-moz-touch-enabled") { - return !static_prefs::pref!("layout.css.moz-touch-enabled.enabled"); + #[cfg(feature = "gecko")] + { + if *feature == atom!("-moz-touch-enabled") { + return !static_prefs::pref!("layout.css.moz-touch-enabled.enabled"); + } } false } diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs index 424a9cf17c4e..fe4d3cceaf88 100644 --- a/components/style/properties/properties.mako.rs +++ b/components/style/properties/properties.mako.rs @@ -1877,10 +1877,13 @@ impl PropertyId { return Ok(match *id { StaticId::Longhand(id) => PropertyId::Longhand(id), StaticId::Shorthand(id) => { - // We want to count `zoom` even if disabled. - if matches!(id, ShorthandId::Zoom) { - if let Some(counters) = use_counters { - counters.non_custom_properties.record(id.into()); + #[cfg(feature = "gecko")] + { + // We want to count `zoom` even if disabled. + if matches!(id, ShorthandId::Zoom) { + if let Some(counters) = use_counters { + counters.non_custom_properties.record(id.into()); + } } } diff --git a/components/style/values/computed/length.rs b/components/style/values/computed/length.rs index 5665c1e7373c..53cf7cbd6965 100644 --- a/components/style/values/computed/length.rs +++ b/components/style/values/computed/length.rs @@ -607,7 +607,6 @@ impl Size { } /// The computed `` value. -#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))] #[derive( Animate, Clone,