servo: Merge #15747 - Fix wrong index for missing properties in keyframes (from hiikezoe:fix-wrong-index-in-keyframe); r=emilio
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Mon, 27 Feb 2017 02:28:55 -0800
changeset 374036 0260913ef653610e3b5183c037512b99423cd898
parent 374035 596b62a60edf2acf7c2f8d1e294d13fb4ca1a75f
child 374037 bd53f4115df69503d4b47b04e4f030e87679923b
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs15747, 1342323
milestone54.0a1
servo: Merge #15747 - Fix wrong index for missing properties in keyframes (from hiikezoe:fix-wrong-index-in-keyframe); r=emilio <!-- Please describe your changes on the following line: --> This is PR of https://bugzilla.mozilla.org/show_bug.cgi?id=1342323 , reviewed by @emilio. Thank you Emilio! --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because it's for stylo. I think we have test cases for this in gecko tree. <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 29e3347242c6cc6e23babce15fe0aceae4259a04
servo/ports/geckolib/glue.rs
--- a/servo/ports/geckolib/glue.rs
+++ b/servo/ports/geckolib/glue.rs
@@ -1499,19 +1499,21 @@ pub extern "C" fn Servo_StyleSet_FillKey
                               seen.set_transition_property_bit(&property);
                           }
                       }
                   }
 
                   // Append missing property values in the initial or the finial keyframes.
                   if step.start_percentage.0 == 0. ||
                      step.start_percentage.0 == 1. {
-                      for (index, property) in animation.properties_changed.iter().enumerate() {
+                      let mut index = unsafe { (*keyframe).mPropertyValues.len() };
+                      for property in animation.properties_changed.iter() {
                           if !seen.has_transition_property_bit(&property) {
                               add_computed_property_value(keyframe, index, style, property);
+                              index += 1;
                           }
                       }
                   }
               },
           }
        }
        return true
     }