From 3991ab9999111cba58cdcc0ee43daf49da1e22d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Fri, 24 Jan 2020 11:46:14 +0000 Subject: [PATCH] style: Make direction use an enum class. Differential Revision: https://phabricator.services.mozilla.com/D60857 --- components/style/properties/helpers.mako.rs | 3 ++- components/style/properties/longhands/inherited_box.mako.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/components/style/properties/helpers.mako.rs b/components/style/properties/helpers.mako.rs index 4d3895440d54..7a25b2569eae 100644 --- a/components/style/properties/helpers.mako.rs +++ b/components/style/properties/helpers.mako.rs @@ -563,6 +563,7 @@ Copy, Debug, Eq, + FromPrimitive, Hash, MallocSizeOf, Parse, @@ -762,7 +763,7 @@ % endif pub mod computed_value { #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))] - #[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToCss, ToResolvedValue)] + #[derive(Clone, Copy, Debug, Eq, FromPrimitive, MallocSizeOf, PartialEq, ToCss, ToResolvedValue)] % if not extra_specified: #[derive(Parse, SpecifiedValueInfo, ToComputedValue, ToShmem)] % endif diff --git a/components/style/properties/longhands/inherited_box.mako.rs b/components/style/properties/longhands/inherited_box.mako.rs index 78c2e6023ee5..e7715431b5e0 100644 --- a/components/style/properties/longhands/inherited_box.mako.rs +++ b/components/style/properties/longhands/inherited_box.mako.rs @@ -43,7 +43,7 @@ ${helpers.single_keyword( servo_2020_pref="layout.2020.unimplemented", animation_value_type="none", spec="https://drafts.csswg.org/css-writing-modes/#propdef-direction", - needs_conversion=True, + gecko_enum_prefix="StyleDirection", servo_restyle_damage="rebuild_and_reflow", )}