style: Unify a bit Servo and Gecko code in properties.mako.rs.

Mostly removing #[cfg] statements, so npotb.
This commit is contained in:
Emilio Cobos Álvarez 2019-04-16 17:34:50 +02:00
parent 09d497db3d
commit 477bda81d3
2 changed files with 2 additions and 7 deletions

View file

@ -1104,9 +1104,6 @@ impl ${style_struct.gecko_struct_name} {
} }
result result
} }
pub fn get_gecko(&self) -> &${style_struct.gecko_ffi_name} {
&self.gecko
}
} }
impl Drop for ${style_struct.gecko_struct_name} { impl Drop for ${style_struct.gecko_struct_name} {
fn drop(&mut self) { fn drop(&mut self) {

View file

@ -27,7 +27,7 @@ use crate::context::QuirksMode;
#[cfg(feature = "servo")] use crate::logical_geometry::LogicalMargin; #[cfg(feature = "servo")] use crate::logical_geometry::LogicalMargin;
#[cfg(feature = "servo")] use crate::computed_values; #[cfg(feature = "servo")] use crate::computed_values;
use crate::logical_geometry::WritingMode; 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::media_queries::Device;
use crate::parser::ParserContext; use crate::parser::ParserContext;
use crate::properties::longhands::system_font::SystemFont; use crate::properties::longhands::system_font::SystemFont;
@ -376,7 +376,6 @@ impl PartialEq for PropertyDeclaration {
} }
} }
#[cfg(feature = "gecko")]
impl MallocSizeOf for PropertyDeclaration { impl MallocSizeOf for PropertyDeclaration {
#[inline] #[inline]
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize { 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. /// An identifier for a given alias property.
#[derive(Clone, Copy, Eq, PartialEq)] #[derive(Clone, Copy, Eq, PartialEq, MallocSizeOf)]
#[cfg_attr(feature = "servo", derive(MallocSizeOf))]
#[repr(u16)] #[repr(u16)]
pub enum AliasId { pub enum AliasId {
% for i, property in enumerate(data.all_aliases()): % for i, property in enumerate(data.all_aliases()):