Bug 1304922 - Part 10: Drop non-const version of KeyframeEffectReadOnly::Properties(). r?birtles draft
authorHiroyuki Ikezoe <hiikezoe@mozilla-japan.org>
Wed, 05 Oct 2016 14:54:01 +0900
changeset 421035 2e3149305df019ce32b91854686a15690b8daba4
parent 421034 b11c0e6479bfa90700343655306d2f48805e7fea
child 421036 832739dd926706bf393bdcf3a9f626d6cfcd4567
push id31361
push userbmo:hiikezoe@mozilla-japan.org
push dateWed, 05 Oct 2016 06:56:42 +0000
reviewersbirtles
bugs1304922
milestone52.0a1
Bug 1304922 - Part 10: Drop non-const version of KeyframeEffectReadOnly::Properties(). r?birtles We no longer modify AnimationProperty outside KeyframeEffectReadOnly class. MozReview-Commit-ID: 1YJglDhuS1w
dom/animation/KeyframeEffectReadOnly.h
layout/base/nsLayoutUtils.cpp
--- a/dom/animation/KeyframeEffectReadOnly.h
+++ b/dom/animation/KeyframeEffectReadOnly.h
@@ -229,20 +229,16 @@ public:
   bool HasAnimationOfProperty(nsCSSPropertyID aProperty) const
   {
     return GetAnimationOfProperty(aProperty) != nullptr;
   }
   const InfallibleTArray<AnimationProperty>& Properties() const
   {
     return mProperties;
   }
-  InfallibleTArray<AnimationProperty>& Properties()
-  {
-    return mProperties;
-  }
 
   // Update |mProperties| by recalculating from |mKeyframes| using
   // |aStyleContext| to resolve specified values.
   void UpdateProperties(nsStyleContext* aStyleContext);
 
   // Updates |aStyleRule| with the animation values produced by this
   // AnimationEffect for the current time except any properties contained
   // in |aPropertiesToSkip|.
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -549,20 +549,20 @@ GetMinAndMaxScaleForAnimationProperty(co
     // which are, by definition, "relevant" animations (animations that are
     // not yet finished or which are filling forwards).
     MOZ_ASSERT(anim->IsRelevant());
 
     dom::KeyframeEffectReadOnly* effect =
       anim->GetEffect() ? anim->GetEffect()->AsKeyframeEffect() : nullptr;
     MOZ_ASSERT(effect, "A playing animation should have a keyframe effect");
     for (size_t propIdx = effect->Properties().Length(); propIdx-- != 0; ) {
-      AnimationProperty& prop = effect->Properties()[propIdx];
+      const AnimationProperty& prop = effect->Properties()[propIdx];
       if (prop.mProperty == eCSSProperty_transform) {
         for (uint32_t segIdx = prop.mSegments.Length(); segIdx-- != 0; ) {
-          AnimationPropertySegment& segment = prop.mSegments[segIdx];
+          const AnimationPropertySegment& segment = prop.mSegments[segIdx];
           gfxSize from = segment.mFromValue.GetScaleValue(aFrame);
           aMaxScale.width = std::max<float>(aMaxScale.width, from.width);
           aMaxScale.height = std::max<float>(aMaxScale.height, from.height);
           aMinScale.width = std::min<float>(aMinScale.width, from.width);
           aMinScale.height = std::min<float>(aMinScale.height, from.height);
           gfxSize to = segment.mToValue.GetScaleValue(aFrame);
           aMaxScale.width = std::max<float>(aMaxScale.width, to.width);
           aMaxScale.height = std::max<float>(aMaxScale.height, to.height);