Bug 1125455 patch 5 - Add Animation::GetAnimationOfProperty. r=birtles

This is needed for patch 6.
This commit is contained in:
L. David Baron 2015-03-19 21:10:00 -07:00
parent 8a2f72aac3
commit 1f6efa245f
2 changed files with 9 additions and 5 deletions

View File

@ -252,16 +252,16 @@ Animation::IsInEffect() const
return computedTiming.mTimeFraction != ComputedTiming::kNullTimeFraction;
}
bool
Animation::HasAnimationOfProperty(nsCSSProperty aProperty) const
const AnimationProperty*
Animation::GetAnimationOfProperty(nsCSSProperty aProperty) const
{
for (size_t propIdx = 0, propEnd = mProperties.Length();
propIdx != propEnd; ++propIdx) {
if (aProperty == mProperties[propIdx].mProperty) {
return true;
return &mProperties[propIdx];
}
}
return false;
return nullptr;
}
void

View File

@ -305,7 +305,11 @@ public:
bool IsCurrent() const;
bool IsInEffect() const;
bool HasAnimationOfProperty(nsCSSProperty aProperty) const;
const AnimationProperty*
GetAnimationOfProperty(nsCSSProperty aProperty) const;
bool HasAnimationOfProperty(nsCSSProperty aProperty) const {
return GetAnimationOfProperty(aProperty) != nullptr;
}
const InfallibleTArray<AnimationProperty>& Properties() const {
return mProperties;
}