Bug 1181392 part 4 - Remove use of IsFinishedTransition from nsLayoutUtils; r=dbaron
authorBrian Birtles <birtles@gmail.com>
Fri, 07 Aug 2015 12:29:36 +0900
changeset 256750 f8b8e1084b4080b39a8278112aa4519cd0db0eba
parent 256749 bcf2c0c393cf0642f7a100c3e4e7d6b0b6b748f5
child 256751 c9b2670f5c1a1fed0cef6b7fa2b98b1f3fa789be
push id29187
push usercbook@mozilla.com
push dateFri, 07 Aug 2015 11:13:32 +0000
treeherdermozilla-central@3e51753a099f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs1181392
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1181392 part 4 - Remove use of IsFinishedTransition from nsLayoutUtils; r=dbaron GetMinAndMaxScaleForAnimationProperty in nsLayoutUtils uses IsFinishedTransition to ignore finished transitions since they should not have any effect on current or future scale values. We can generalize this, however, and say we are only interested in animations that are *either*: a) running or scheduled to run in the future, i.e. "current", OR b) applying a value, including a finished animation with a forwards fill, i.e. "in effect" Elsewhere, animations that fulfil *either* of this conditions are referred to as "relevant animations" so we can simply test for relevance in this function.
layout/base/nsLayoutUtils.cpp
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -459,17 +459,17 @@ GetSuitableScale(float aMaxScale, float 
 static void
 GetMinAndMaxScaleForAnimationProperty(const nsIFrame* aFrame,
                                       AnimationCollection* aAnimations,
                                       gfxSize& aMaxScale,
                                       gfxSize& aMinScale)
 {
   for (size_t animIdx = aAnimations->mAnimations.Length(); animIdx-- != 0; ) {
     dom::Animation* anim = aAnimations->mAnimations[animIdx];
-    if (!anim->GetEffect() || anim->GetEffect()->IsFinishedTransition()) {
+    if (!anim->IsRelevant()) {
       continue;
     }
     dom::KeyframeEffectReadOnly* effect = anim->GetEffect();
     for (size_t propIdx = effect->Properties().Length(); propIdx-- != 0; ) {
       AnimationProperty& prop = effect->Properties()[propIdx];
       if (prop.mProperty == eCSSProperty_transform) {
         for (uint32_t segIdx = prop.mSegments.Length(); segIdx-- != 0; ) {
           AnimationPropertySegment& segment = prop.mSegments[segIdx];