mirror of
https://github.com/servo/servo.git
synced 2025-06-22 16:18:59 +01:00
Set nsStyleDisplay::mOriginalDisplay when computing display property.
MozReview-Commit-ID: JkjkCDUfcfE
This commit is contained in:
parent
7a4a37870c
commit
05ceafa981
1 changed files with 18 additions and 1 deletions
|
@ -1035,7 +1035,24 @@ fn static_assert() {
|
||||||
"-moz-groupbox",
|
"-moz-groupbox",
|
||||||
gecko_enum_prefix="StyleDisplay",
|
gecko_enum_prefix="StyleDisplay",
|
||||||
gecko_strip_moz_prefix=False) %>
|
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.
|
// 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.
|
// We could generalize this if we run into other newtype keywords.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue