Bug 1336668 - Make align-items animatable as discrete type. r?emilio
MozReview-Commit-ID: 5mnHMjSk4Lq
--- a/servo/components/style/properties/gecko.mako.rs
+++ b/servo/components/style/properties/gecko.mako.rs
@@ -1070,16 +1070,22 @@ fn static_assert() {
${impl_simple_copy('justify_self', 'mJustifySelf')}
pub fn set_align_items(&mut self, v: longhands::align_items::computed_value::T) {
self.gecko.mAlignItems = v.0.bits()
}
${impl_simple_copy('align_items', 'mAlignItems')}
+ pub fn clone_align_items(&self) -> longhands::align_items::computed_value::T {
+ use values::specified::align::{AlignFlags, AlignItems};
+ AlignItems(AlignFlags::from_bits(self.gecko.mAlignItems)
+ .expect("mAlignItems contains valid flags"))
+ }
+
pub fn set_justify_items(&mut self, v: longhands::justify_items::computed_value::T) {
self.gecko.mJustifyItems = v.0.bits()
}
${impl_simple_copy('justify_items', 'mJustifyItems')}
pub fn clone_justify_items(&self) -> longhands::justify_items::computed_value::T {
use values::specified::align::{AlignFlags, JustifyItems};
--- a/servo/components/style/properties/longhand/position.mako.rs
+++ b/servo/components/style/properties/longhand/position.mako.rs
@@ -60,34 +60,33 @@
// FIXME: Update Servo to support the same Syntax as Gecko.
${helpers.single_keyword("align-content", "stretch flex-start flex-end center space-between space-around",
extra_prefixes="webkit",
spec="https://drafts.csswg.org/css-align/#propdef-align-content",
animation_type="none")}
${helpers.single_keyword("align-items",
"stretch flex-start flex-end center baseline",
- need_clone=True,
extra_prefixes="webkit",
spec="https://drafts.csswg.org/css-flexbox/#align-items-property",
- animation_type="none")}
+ animation_type="discrete")}
% else:
${helpers.predefined_type(name="align-content",
type="AlignJustifyContent",
initial_value="specified::AlignJustifyContent::normal()",
spec="https://drafts.csswg.org/css-align/#propdef-align-content",
extra_prefixes="webkit",
animation_type="none")}
${helpers.predefined_type(name="align-items",
type="AlignItems",
initial_value="specified::AlignItems::normal()",
spec="https://drafts.csswg.org/css-align/#propdef-align-items",
extra_prefixes="webkit",
- animation_type="none")}
+ animation_type="discrete")}
${helpers.predefined_type(name="justify-items",
type="JustifyItems",
initial_value="specified::JustifyItems::auto()",
spec="https://drafts.csswg.org/css-align/#propdef-justify-items",
animation_type="none")}
% endif