From 76ea22d50c502270b65697d5efb1fe732b125440 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Mon, 28 Jan 2019 00:04:06 +0000 Subject: [PATCH] style: Simplify some conversion code used for mapped attributes. These days for the types we share computed value representation we don't really need any special code. Differential Revision: https://phabricator.services.mozilla.com/D17763 --- components/style/properties/longhands/border.mako.rs | 9 --------- components/style/values/computed/box.rs | 4 ++-- components/style/values/specified/border.rs | 1 + 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/components/style/properties/longhands/border.mako.rs b/components/style/properties/longhands/border.mako.rs index b9d3425f84a..c9d6b7f5e19 100644 --- a/components/style/properties/longhands/border.mako.rs +++ b/components/style/properties/longhands/border.mako.rs @@ -61,15 +61,6 @@ )} % endfor -${helpers.gecko_keyword_conversion( - Keyword('border-style', - "none solid double dotted dashed hidden groove ridge inset outset", - gecko_enum_prefix="StyleBorderStyle", - gecko_inexhaustive=True), - type="crate::values::specified::BorderStyle", -)} - -// FIXME(#4126): when gfx supports painting it, make this Size2D % for corner in ALL_CORNERS: <% corner_name = corner[0] diff --git a/components/style/values/computed/box.rs b/components/style/values/computed/box.rs index 38d021d9829..3ce2e611a54 100644 --- a/components/style/values/computed/box.rs +++ b/components/style/values/computed/box.rs @@ -38,7 +38,7 @@ pub type Perspective = GenericPerspective; #[allow(missing_docs)] #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))] #[derive( - Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss, + Clone, Copy, Debug, Eq, FromPrimitive, Hash, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss, )] #[repr(u8)] /// A computed value for the `float` property. @@ -97,7 +97,7 @@ impl ToComputedValue for SpecifiedFloat { #[allow(missing_docs)] #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))] #[derive( - Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss, + Clone, Copy, Debug, Eq, FromPrimitive, Hash, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss, )] /// A computed value for the `clear` property. pub enum Clear { diff --git a/components/style/values/specified/border.rs b/components/style/values/specified/border.rs index c3f1dd6f4af..e16d37b4786 100644 --- a/components/style/values/specified/border.rs +++ b/components/style/values/specified/border.rs @@ -30,6 +30,7 @@ use style_traits::{CssWriter, ParseError, ToCss}; Copy, Debug, Eq, + FromPrimitive, MallocSizeOf, Ord, Parse,