diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index 00be40d30a9..c424ca705a7 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -1035,7 +1035,24 @@ fn static_assert() { "-moz-groupbox", gecko_enum_prefix="StyleDisplay", gecko_strip_moz_prefix=False) %> - ${impl_keyword('display', 'mDisplay', display_keyword, True)} + + pub fn set_display(&mut self, v: longhands::display::computed_value::T) { + use properties::longhands::display::computed_value::T as Keyword; + // FIXME(bholley): Align binary representations and ditch |match| for cast + static_asserts + let result = match v { + % for value in display_keyword.values_for('gecko'): + Keyword::${to_rust_ident(value)} => + structs::${display_keyword.gecko_constant(value)}, + % endfor + }; + self.gecko.mDisplay = result; + self.gecko.mOriginalDisplay = result; + } + pub fn copy_display_from(&mut self, other: &Self) { + self.gecko.mDisplay = other.gecko.mDisplay; + self.gecko.mOriginalDisplay = other.gecko.mOriginalDisplay; + } + <%call expr="impl_keyword_clone('display', 'mDisplay', display_keyword)"> // overflow-y is implemented as a newtype of overflow-x, so we need special handling. // We could generalize this if we run into other newtype keywords.