From 18de4dd75d75f0ba12e077a8b4b707f29f021e11 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Fri, 28 Nov 2014 17:43:14 +0000 Subject: [PATCH 1/2] =?UTF-8?q?style::properties::longhand=20shouldn?= =?UTF-8?q?=E2=80=99t=20be=20public.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/style/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/style/lib.rs b/components/style/lib.rs index aa9bc551dd3..e6e0e77f7a5 100644 --- a/components/style/lib.rs +++ b/components/style/lib.rs @@ -46,7 +46,7 @@ pub use properties::{cascade, cascade_anonymous, computed}; pub use properties::{PropertyDeclaration, ComputedValues, computed_values, style_structs}; pub use properties::{PropertyDeclarationBlock, parse_style_attribute}; // Style attributes pub use properties::{CSSFloat, DeclaredValue, PropertyDeclarationParseResult}; -pub use properties::{longhands, Angle, AngleOrCorner, AngleAoc, CornerAoc}; +pub use properties::{Angle, AngleOrCorner, AngleAoc, CornerAoc}; pub use properties::{Left, Right, Bottom, Top}; pub use node::{TElement, TElementAttributes, TNode}; pub use selectors::{PseudoElement, Before, After, SelectorList, parse_selector_list_from_str}; From c6ff02199d2811ade854aa8df6b36d70429bdbea Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Fri, 28 Nov 2014 17:44:00 +0000 Subject: [PATCH 2/2] Remove dead code --- components/style/properties/common_types.rs | 2 -- components/style/properties/mod.rs.mako | 31 ++++++++------------- 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/components/style/properties/common_types.rs b/components/style/properties/common_types.rs index d527e024929..4f68f77bcd0 100644 --- a/components/style/properties/common_types.rs +++ b/components/style/properties/common_types.rs @@ -10,8 +10,6 @@ pub use servo_util::geometry::Au; pub type CSSFloat = f64; -pub static DEFAULT_LINE_HEIGHT: CSSFloat = 1.14; - pub mod specified { use std::ascii::AsciiExt; use std::f64::consts::PI; diff --git a/components/style/properties/mod.rs.mako b/components/style/properties/mod.rs.mako index dabf5452c9b..789dc14f45f 100644 --- a/components/style/properties/mod.rs.mako +++ b/components/style/properties/mod.rs.mako @@ -1487,26 +1487,19 @@ mod property_bit_field { fn set(&mut self, bit: uint) { self.storage[bit / uint::BITS] |= 1 << (bit % uint::BITS) } - #[inline] - fn clear(&mut self, bit: uint) { - self.storage[bit / uint::BITS] &= !(1 << (bit % uint::BITS)) - } % for i, property in enumerate(LONGHANDS): - #[allow(non_snake_case)] - #[inline] - pub fn get_${property.ident}(&self) -> bool { - self.get(${i}) - } - #[allow(non_snake_case)] - #[inline] - pub fn set_${property.ident}(&mut self) { - self.set(${i}) - } - #[allow(non_snake_case)] - #[inline] - pub fn clear_${property.ident}(&mut self) { - self.clear(${i}) - } + % if property.derived_from is None: + #[allow(non_snake_case)] + #[inline] + pub fn get_${property.ident}(&self) -> bool { + self.get(${i}) + } + #[allow(non_snake_case)] + #[inline] + pub fn set_${property.ident}(&mut self) { + self.set(${i}) + } + % endif % endfor } }