Bug 1420928 - Make transition_combined_duration_at consider duration and delay value are used by repeating the list of values if the given index is greater than the list length. r?boris draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Thu, 04 Jan 2018 18:24:24 +0900
changeset 715626 d28796cc3e181e92f4ee86d6dda786a2b88f15dd
parent 715625 a88bdbb6f81ca9aae31c0bade55b396abf9697c3
child 715627 43b597c395b4e8943454cfa7c7629af1471d4d2c
push id94212
push userhikezoe@mozilla.com
push dateThu, 04 Jan 2018 09:34:32 +0000
reviewersboris
bugs1420928
milestone59.0a1
Bug 1420928 - Make transition_combined_duration_at consider duration and delay value are used by repeating the list of values if the given index is greater than the list length. r?boris MozReview-Commit-ID: HQcLlE5YxyJ
servo/components/style/properties/gecko.mako.rs
--- a/servo/components/style/properties/gecko.mako.rs
+++ b/servo/components/style/properties/gecko.mako.rs
@@ -3293,17 +3293,18 @@ fn static_assert() {
     ${impl_css_url('_moz_binding', 'mBinding')}
 
     ${impl_transition_time_value('delay', 'Delay')}
     ${impl_transition_time_value('duration', 'Duration')}
     ${impl_transition_timing_function()}
 
     pub fn transition_combined_duration_at(&self, index: usize) -> f32 {
         // https://drafts.csswg.org/css-transitions/#transition-combined-duration
-        self.gecko.mTransitions[index].mDuration.max(0.0) + self.gecko.mTransitions[index].mDelay
+        self.gecko.mTransitions[index % self.gecko.mTransitionDurationCount as usize].mDuration.max(0.0)
+            + self.gecko.mTransitions[index % self.gecko.mTransitionDelayCount as usize].mDelay
     }
 
     pub fn set_transition_property<I>(&mut self, v: I)
         where I: IntoIterator<Item = longhands::transition_property::computed_value::single_value::T>,
               I::IntoIter: ExactSizeIterator
     {
         use gecko_bindings::structs::nsCSSPropertyID::eCSSPropertyExtra_no_properties;