Bug 1343751 - Pass transition-delay and transition-duration into gecko struct. r?emilio draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Fri, 03 Mar 2017 06:50:17 +0900
changeset 492181 bb3933ec9aec9b6609f5e3510b269085517495b2
parent 492180 5471e2536d7bdb3b18b3f94104b0f61762cffda4
child 492182 70f9295e33e13fd58ea87a905315b41299a3225d
push id47550
push userhikezoe@mozilla.com
push dateThu, 02 Mar 2017 21:55:07 +0000
reviewersemilio
bugs1343751
milestone54.0a1
Bug 1343751 - Pass transition-delay and transition-duration into gecko struct. r?emilio MozReview-Commit-ID: 80BcgKpQyU6
servo/components/style/properties/gecko.mako.rs
--- a/servo/components/style/properties/gecko.mako.rs
+++ b/servo/components/style/properties/gecko.mako.rs
@@ -617,18 +617,18 @@ impl Debug for ${style_struct.gecko_stru
     force_stub += ["list-style-type"]
 
     # These are part of shorthands so we must include them in stylo builds,
     # but we haven't implemented the stylo glue for the longhand
     # so we generate a stub
     force_stub += ["flex-basis", # position
 
                    # transition
-                   "transition-duration", "transition-timing-function",
-                   "transition-property", "transition-delay",
+                   "transition-timing-function",
+                   "transition-property",
                    ]
 
     # Types used with predefined_type()-defined properties that we can auto-generate.
     predefined_types = {
         "length::LengthOrAuto": impl_style_coord,
         "length::LengthOrNormal": impl_style_coord,
         "Length": impl_absolute_length,
         "Position": impl_position,
@@ -1337,16 +1337,20 @@ fn static_assert() {
         -> longhands::${type}_${ident}::computed_value::SingleComputedValue {
         use values::specified::Time;
         Time(self.gecko.mAnimations[index].m${gecko_ffi_name} / 1000.)
     }
     ${impl_animation_or_transition_count(type, ident, gecko_ffi_name)}
     ${impl_copy_animation_or_transition_value(type, ident, gecko_ffi_name)}
 </%def>
 
+<%def name="impl_transition_time_value(ident, gecko_ffi_name)">
+    ${impl_animation_or_transition_time_value('transition', ident, gecko_ffi_name)}
+</%def>
+
 <%def name="impl_copy_animation_value(ident, gecko_ffi_name)">
     ${impl_copy_animation_or_transition_value('animation', ident, gecko_ffi_name)}
 </%def>
 
 <%def name="impl_animation_count(ident, gecko_ffi_name)">
     ${impl_animation_or_transition_count('animation', ident, gecko_ffi_name)}
 </%def>
 
@@ -1389,16 +1393,17 @@ fn static_assert() {
     ${impl_animation_count(ident, gecko_ffi_name)}
     ${impl_copy_animation_value(ident, gecko_ffi_name)}
 </%def>
 
 <% skip_box_longhands= """display overflow-y vertical-align
                           animation-name animation-delay animation-duration
                           animation-direction animation-fill-mode animation-play-state
                           animation-iteration-count animation-timing-function
+                          transition-duration transition-delay
                           page-break-before page-break-after
                           scroll-snap-points-x scroll-snap-points-y transform
                           scroll-snap-type-y scroll-snap-coordinate
                           perspective-origin transform-origin""" %>
 <%self:impl_trait style_struct_name="Box" skip_longhands="${skip_box_longhands}">
 
     // We manually-implement the |display| property until we get general
     // infrastructure for preffing certain values.
@@ -1732,16 +1737,19 @@ fn static_assert() {
                 }
             };
             result.push(servo);
             unsafe { cur = (&*cur).mNext };
         }
         computed_value::T(Some(result))
     }
 
+    ${impl_transition_time_value('delay', 'Delay')}
+    ${impl_transition_time_value('duration', 'Duration')}
+
     pub fn set_animation_name(&mut self, v: longhands::animation_name::computed_value::T) {
         use nsstring::nsCString;
         unsafe { self.gecko.mAnimations.ensure_len(v.0.len()) };
 
         if v.0.len() > 0 {
             self.gecko.mAnimationNameCount = v.0.len() as u32;
             for (servo, gecko) in v.0.into_iter().zip(self.gecko.mAnimations.iter_mut()) {
                 gecko.mName.assign_utf8(&nsCString::from(servo.0.to_string()));