From 477bda81d34dbfc1709d7d81775fdb28e1f791d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Tue, 16 Apr 2019 17:34:50 +0200 Subject: [PATCH] style: Unify a bit Servo and Gecko code in properties.mako.rs. Mostly removing #[cfg] statements, so npotb. --- components/style/properties/gecko.mako.rs | 3 --- components/style/properties/properties.mako.rs | 6 ++---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index 95afdd56a79..2dde6af2a57 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -1104,9 +1104,6 @@ impl ${style_struct.gecko_struct_name} { } result } - pub fn get_gecko(&self) -> &${style_struct.gecko_ffi_name} { - &self.gecko - } } impl Drop for ${style_struct.gecko_struct_name} { fn drop(&mut self) { diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs index 5f44a259641..9943c3509e6 100644 --- a/components/style/properties/properties.mako.rs +++ b/components/style/properties/properties.mako.rs @@ -27,7 +27,7 @@ use crate::context::QuirksMode; #[cfg(feature = "servo")] use crate::logical_geometry::LogicalMargin; #[cfg(feature = "servo")] use crate::computed_values; use crate::logical_geometry::WritingMode; -#[cfg(feature = "gecko")] use malloc_size_of::{MallocSizeOf, MallocSizeOfOps}; +use malloc_size_of::{MallocSizeOf, MallocSizeOfOps}; use crate::media_queries::Device; use crate::parser::ParserContext; use crate::properties::longhands::system_font::SystemFont; @@ -376,7 +376,6 @@ impl PartialEq for PropertyDeclaration { } } -#[cfg(feature = "gecko")] impl MallocSizeOf for PropertyDeclaration { #[inline] fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize { @@ -3745,8 +3744,7 @@ pub fn adjust_border_width(style: &mut StyleBuilder) { } /// An identifier for a given alias property. -#[derive(Clone, Copy, Eq, PartialEq)] -#[cfg_attr(feature = "servo", derive(MallocSizeOf))] +#[derive(Clone, Copy, Eq, PartialEq, MallocSizeOf)] #[repr(u16)] pub enum AliasId { % for i, property in enumerate(data.all_aliases()):