diff --git a/components/style/properties/longhands/box.mako.rs b/components/style/properties/longhands/box.mako.rs index 06742d45e68..dcc29227301 100644 --- a/components/style/properties/longhands/box.mako.rs +++ b/components/style/properties/longhands/box.mako.rs @@ -23,24 +23,6 @@ ${helpers.predefined_type( needs_context=product == "gecko" )} -// FIXME(emilio): Listing all the display values here is very unfortunate, we should teach C++ to use the -// Rust enum directly, or generate the conversions to `StyleDisplay`. -${helpers.gecko_keyword_conversion( - Keyword('display', """ - inline block inline-block - table inline-table table-row-group table-header-group table-footer-group - table-row table-column-group table-column table-cell table-caption - list-item none flex inline-flex grid inline-grid ruby ruby-base ruby-base-container - ruby-text ruby-text-container contents flow-root -webkit-box - -webkit-inline-box -moz-box -moz-inline-box -moz-grid -moz-inline-grid - -moz-grid-group -moz-grid-line -moz-stack -moz-inline-stack -moz-deck - -moz-popup -moz-groupbox - """, - gecko_enum_prefix='StyleDisplay', - gecko_strip_moz_prefix=False), - type="::values::specified::Display" -)} - ${helpers.single_keyword( "-moz-top-layer", "none top", diff --git a/components/style/values/specified/box.rs b/components/style/values/specified/box.rs index 6b474689df3..9554d76890c 100644 --- a/components/style/values/specified/box.rs +++ b/components/style/values/specified/box.rs @@ -57,8 +57,8 @@ fn moz_box_display_values_enabled(context: &ParserContext) -> bool { /// Also, when you change this from Gecko you may need to regenerate the /// C++-side bindings (see components/style/cbindgen.toml). #[allow(missing_docs)] -#[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse, PartialEq, - SpecifiedValueInfo, ToComputedValue, ToCss)] +#[derive(Clone, Copy, Debug, Eq, FromPrimitive, Hash, MallocSizeOf, Parse, + PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)] #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))] #[repr(u8)] pub enum Display {