Bug 1145246, part 3 - Update layout code for the rename of Animatable.getAnimationPlayers() to Animatable.getAnimations(). r=birtles

This commit is contained in:
Jonathan Watt 2015-03-20 18:20:49 +00:00
parent fe226713f5
commit 0aa30fe55c
8 changed files with 24 additions and 24 deletions

View File

@ -219,7 +219,7 @@ public:
// cached when used from JS.
already_AddRefed<AnimationEffect> GetEffect();
Element* GetTarget() const {
// Currently we only implement Element.getAnimationPlayers() which only
// Currently we only implement Element.getAnimations() which only
// returns animations targetting Elements so this should never
// be called for an animation that targets a pseudo-element.
MOZ_ASSERT(mPseudoType == nsCSSPseudoElements::ePseudo_NotPseudoElement,

View File

@ -767,7 +767,7 @@ AnimationPlayer::GetCollection() const
MOZ_ASSERT(targetElement,
"A player with an animation manager must have a target");
return manager->GetAnimationPlayers(targetElement, targetPseudoType, false);
return manager->GetAnimations(targetElement, targetPseudoType, false);
}
} // namespace dom

View File

@ -1238,10 +1238,10 @@ RestyleManager::GetMaxAnimationGenerationForFrame(nsIFrame* aFrame)
nsCSSPseudoElements::Type pseudoType =
aFrame->StyleContext()->GetPseudoType();
AnimationPlayerCollection* transitions =
aFrame->PresContext()->TransitionManager()->GetAnimationPlayers(
aFrame->PresContext()->TransitionManager()->GetAnimations(
content->AsElement(), pseudoType, false /* don't create */);
AnimationPlayerCollection* animations =
aFrame->PresContext()->AnimationManager()->GetAnimationPlayers(
aFrame->PresContext()->AnimationManager()->GetAnimations(
content->AsElement(), pseudoType, false /* don't create */);
return std::max(transitions ? transitions->mAnimationGeneration : 0,

View File

@ -303,7 +303,7 @@ CommonAnimationManager::ExtractComputedValueForTransition(
}
AnimationPlayerCollection*
CommonAnimationManager::GetAnimationPlayers(dom::Element *aElement,
CommonAnimationManager::GetAnimations(dom::Element *aElement,
nsCSSPseudoElements::Type aPseudoType,
bool aCreateIfNeeded)
{
@ -366,7 +366,7 @@ CommonAnimationManager::GetAnimationRule(mozilla::dom::Element* aElement,
}
AnimationPlayerCollection* collection =
GetAnimationPlayers(aElement, aPseudoType, false);
GetAnimations(aElement, aPseudoType, false);
if (!collection) {
return nullptr;
}

View File

@ -76,7 +76,7 @@ public:
void AddStyleUpdatesTo(mozilla::RestyleTracker& aTracker);
AnimationPlayerCollection*
GetAnimationPlayers(dom::Element *aElement,
GetAnimations(dom::Element *aElement,
nsCSSPseudoElements::Type aPseudoType,
bool aCreateIfNeeded);

View File

@ -254,7 +254,7 @@ nsAnimationManager::CheckAnimationRule(nsStyleContext* aStyleContext,
const nsStyleDisplay* disp = aStyleContext->StyleDisplay();
AnimationPlayerCollection* collection =
GetAnimationPlayers(aElement, aStyleContext->GetPseudoType(), false);
GetAnimations(aElement, aStyleContext->GetPseudoType(), false);
if (!collection &&
disp->mAnimationNameCount == 1 &&
disp->mAnimations[0].GetName().IsEmpty()) {
@ -380,7 +380,7 @@ nsAnimationManager::CheckAnimationRule(nsStyleContext* aStyleContext,
}
} else {
collection =
GetAnimationPlayers(aElement, aStyleContext->GetPseudoType(), true);
GetAnimations(aElement, aStyleContext->GetPseudoType(), true);
}
collection->mPlayers.SwapElements(newPlayers);
collection->mNeedsRefreshes = true;

View File

@ -174,7 +174,7 @@ nsTransitionManager::StyleContextChanged(dom::Element *aElement,
}
AnimationPlayerCollection* collection =
GetAnimationPlayers(aElement, pseudoType, false);
GetAnimations(aElement, pseudoType, false);
if (!collection &&
disp->mTransitionPropertyCount == 1 &&
disp->mTransitions[0].GetCombinedDuration() <= 0.0f) {
@ -566,7 +566,7 @@ nsTransitionManager::ConsiderStartingTransition(
if (!aElementTransitions) {
aElementTransitions =
GetAnimationPlayers(aElement, aNewStyleContext->GetPseudoType(), true);
GetAnimations(aElement, aNewStyleContext->GetPseudoType(), true);
if (!aElementTransitions) {
NS_WARNING("allocating CommonAnimationManager failed");
return;
@ -608,7 +608,7 @@ nsTransitionManager::UpdateCascadeResultsWithTransitions(
{
AnimationPlayerCollection* animations =
mPresContext->AnimationManager()->
GetAnimationPlayers(aTransitions->mElement,
GetAnimations(aTransitions->mElement,
aTransitions->PseudoElementType(), false);
UpdateCascadeResults(aTransitions, animations);
}
@ -619,7 +619,7 @@ nsTransitionManager::UpdateCascadeResultsWithAnimations(
{
AnimationPlayerCollection* transitions =
mPresContext->TransitionManager()->
GetAnimationPlayers(aAnimations->mElement,
GetAnimations(aAnimations->mElement,
aAnimations->PseudoElementType(), false);
UpdateCascadeResults(transitions, aAnimations);
}
@ -633,7 +633,7 @@ nsTransitionManager::UpdateCascadeResultsWithAnimationsToBeDestroyed(
// information that may now be incorrect.
AnimationPlayerCollection* transitions =
mPresContext->TransitionManager()->
GetAnimationPlayers(aAnimations->mElement,
GetAnimations(aAnimations->mElement,
aAnimations->PseudoElementType(), false);
UpdateCascadeResults(transitions, nullptr);
}

View File

@ -48,8 +48,8 @@ addAsyncAnimTest(function *() {
"Animation is initally animating on compositor");
// pause() means it is no longer on the compositor
var player = div.getAnimationPlayers()[0];
player.pause();
var animation = div.getAnimations()[0];
animation.pause();
// pause() should set up the changes to animations for the next layer
// transaction but it won't schedule a paint immediately so we need to tick
// the refresh driver before we can wait on the next paint.
@ -64,7 +64,7 @@ addAsyncAnimTest(function *() {
"Animation remains paused");
// play() puts the animation back on the compositor
player.play();
animation.play();
// As with pause(), play() will set up pending animations for the next layer
// transaction but won't schedule a paint so we need to tick the refresh
// driver before waiting on the next paint.