Set nsStyleDisplay::mOriginalDisplay when computing display property.

MozReview-Commit-ID: JkjkCDUfcfE
This commit is contained in:
Cameron McCormack 2016-12-05 16:14:36 -10:00
parent 7a4a37870c
commit 05ceafa981

View file

@ -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)"></%call>
// 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.