mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1046055 part 3 - Add AnimationPlayerCollection::HasCurrentAnimationsForProperty; r=dbaron
This patch adds another method to AnimationPlayerCollection alongside HasCurrentAnimations that returns true if there is a player in the collection with current source content that targets the specified property. At the same time it also makes the original HasCurrentAnimations a const method.
This commit is contained in:
parent
2349318ce3
commit
6f723f8f19
@ -719,7 +719,7 @@ AnimationPlayerCollection::UpdateAnimationGeneration(
|
||||
}
|
||||
|
||||
bool
|
||||
AnimationPlayerCollection::HasCurrentAnimations()
|
||||
AnimationPlayerCollection::HasCurrentAnimations() const
|
||||
{
|
||||
for (size_t playerIdx = mPlayers.Length(); playerIdx-- != 0; ) {
|
||||
if (mPlayers[playerIdx]->HasCurrentSource()) {
|
||||
@ -730,4 +730,18 @@ AnimationPlayerCollection::HasCurrentAnimations()
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
AnimationPlayerCollection::HasCurrentAnimationsForProperty(nsCSSProperty
|
||||
aProperty) const
|
||||
{
|
||||
for (size_t playerIdx = mPlayers.Length(); playerIdx-- != 0; ) {
|
||||
const Animation* anim = mPlayers[playerIdx]->GetSource();
|
||||
if (anim && anim->IsCurrent() && anim->HasAnimationOfProperty(aProperty)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -304,9 +304,11 @@ struct AnimationPlayerCollection : public PRCList
|
||||
// Update mAnimationGeneration to nsCSSFrameConstructor's count
|
||||
void UpdateAnimationGeneration(nsPresContext* aPresContext);
|
||||
|
||||
// Returns true if there is an animation in the before or active phase
|
||||
// at the current time.
|
||||
bool HasCurrentAnimations();
|
||||
// Returns true if there is an animation that has yet to finish.
|
||||
bool HasCurrentAnimations() const;
|
||||
// Returns true if there is an animation of the specified property that
|
||||
// has yet to finish.
|
||||
bool HasCurrentAnimationsForProperty(nsCSSProperty aProperty) const;
|
||||
|
||||
// The refresh time associated with mStyleRule.
|
||||
TimeStamp mStyleRuleRefreshTime;
|
||||
|
Loading…
Reference in New Issue
Block a user