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
--- 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);