style: Fix Servo build.

This commit is contained in:
Emilio Cobos Álvarez 2019-11-04 13:34:18 +01:00
parent a44515c314
commit 0f512b4432
No known key found for this signature in database
GPG key ID: E1152D0994E4BF8A
3 changed files with 13 additions and 7 deletions

View file

@ -242,10 +242,14 @@ fn consume_operation_or_colon(input: &mut Parser) -> Result<Option<Operator>, ()
})) }))
} }
#[allow(unused_variables)]
fn disabled_by_pref(feature: &Atom) -> bool { fn disabled_by_pref(feature: &Atom) -> bool {
#[cfg(feature = "gecko")]
{
if *feature == atom!("-moz-touch-enabled") { if *feature == atom!("-moz-touch-enabled") {
return !static_prefs::pref!("layout.css.moz-touch-enabled.enabled"); return !static_prefs::pref!("layout.css.moz-touch-enabled.enabled");
} }
}
false false
} }

View file

@ -1877,12 +1877,15 @@ impl PropertyId {
return Ok(match *id { return Ok(match *id {
StaticId::Longhand(id) => PropertyId::Longhand(id), StaticId::Longhand(id) => PropertyId::Longhand(id),
StaticId::Shorthand(id) => { StaticId::Shorthand(id) => {
#[cfg(feature = "gecko")]
{
// We want to count `zoom` even if disabled. // We want to count `zoom` even if disabled.
if matches!(id, ShorthandId::Zoom) { if matches!(id, ShorthandId::Zoom) {
if let Some(counters) = use_counters { if let Some(counters) = use_counters {
counters.non_custom_properties.record(id.into()); counters.non_custom_properties.record(id.into());
} }
} }
}
PropertyId::Shorthand(id) PropertyId::Shorthand(id)
}, },

View file

@ -607,7 +607,6 @@ impl Size {
} }
/// The computed `<length>` value. /// The computed `<length>` value.
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
#[derive( #[derive(
Animate, Animate,
Clone, Clone,