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,9 +303,9 @@ CommonAnimationManager::ExtractComputedValueForTransition(
}
AnimationPlayerCollection*
CommonAnimationManager::GetAnimationPlayers(dom::Element *aElement,
nsCSSPseudoElements::Type aPseudoType,
bool aCreateIfNeeded)
CommonAnimationManager::GetAnimations(dom::Element *aElement,
nsCSSPseudoElements::Type aPseudoType,
bool aCreateIfNeeded)
{
if (!aCreateIfNeeded && PR_CLIST_IS_EMPTY(&mElementCollections)) {
// Early return for the most common case.
@ -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,9 +76,9 @@ public:
void AddStyleUpdatesTo(mozilla::RestyleTracker& aTracker);
AnimationPlayerCollection*
GetAnimationPlayers(dom::Element *aElement,
nsCSSPseudoElements::Type aPseudoType,
bool aCreateIfNeeded);
GetAnimations(dom::Element *aElement,
nsCSSPseudoElements::Type aPseudoType,
bool aCreateIfNeeded);
// Returns true if aContent or any of its ancestors has an animation
// or transition.

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,8 +608,8 @@ nsTransitionManager::UpdateCascadeResultsWithTransitions(
{
AnimationPlayerCollection* animations =
mPresContext->AnimationManager()->
GetAnimationPlayers(aTransitions->mElement,
aTransitions->PseudoElementType(), false);
GetAnimations(aTransitions->mElement,
aTransitions->PseudoElementType(), false);
UpdateCascadeResults(aTransitions, animations);
}
@ -619,8 +619,8 @@ nsTransitionManager::UpdateCascadeResultsWithAnimations(
{
AnimationPlayerCollection* transitions =
mPresContext->TransitionManager()->
GetAnimationPlayers(aAnimations->mElement,
aAnimations->PseudoElementType(), false);
GetAnimations(aAnimations->mElement,
aAnimations->PseudoElementType(), false);
UpdateCascadeResults(transitions, aAnimations);
}
@ -633,8 +633,8 @@ nsTransitionManager::UpdateCascadeResultsWithAnimationsToBeDestroyed(
// information that may now be incorrect.
AnimationPlayerCollection* transitions =
mPresContext->TransitionManager()->
GetAnimationPlayers(aAnimations->mElement,
aAnimations->PseudoElementType(), false);
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.