Bug 1046055 part 2 - Rename AnimationPlayer::IsCurrent to HasCurrentSource; r=dbaron

It's not the player that's "current" (a Web Animations term for an animation
that hasn't yet finished), but its source content, if any. This patch renames
the method on AnimationPlayer accordingly.

At the same time this patch moves the method to the header file since it's
quite simple and could possibly benefit from inlining.
This commit is contained in:
Brian Birtles 2014-10-02 15:14:13 +09:00
parent 46c3ada344
commit 6de21c8b65
4 changed files with 6 additions and 9 deletions

View File

@ -2958,7 +2958,7 @@ Element::GetAnimationPlayers(nsTArray<nsRefPtr<AnimationPlayer> >& aPlayers)
playerIdx < collection->mPlayers.Length();
playerIdx++) {
AnimationPlayer* player = collection->mPlayers[playerIdx];
if (player->IsCurrent()) {
if (player->HasCurrentSource()) {
aPlayers.AppendElement(player);
}
}

View File

@ -64,12 +64,6 @@ AnimationPlayer::IsRunning() const
return computedTiming.mPhase == ComputedTiming::AnimationPhase_Active;
}
bool
AnimationPlayer::IsCurrent() const
{
return GetSource() && GetSource()->IsCurrent();
}
Nullable<TimeDuration>
AnimationPlayer::GetCurrentTimeDuration() const
{

View File

@ -64,7 +64,10 @@ public:
}
bool IsRunning() const;
bool IsCurrent() const;
bool HasCurrentSource() const {
return GetSource() && GetSource()->IsCurrent();
}
// Return the duration since the start time of the player, taking into
// account the pause state. May be negative or null.

View File

@ -722,7 +722,7 @@ bool
AnimationPlayerCollection::HasCurrentAnimations()
{
for (size_t playerIdx = mPlayers.Length(); playerIdx-- != 0; ) {
if (mPlayers[playerIdx]->IsCurrent()) {
if (mPlayers[playerIdx]->HasCurrentSource()) {
return true;
}
}