mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1154615 part 1 - Rename AnimationPlayer to Animation in WebIDL; r=smaug
This patch is a fairly minimal rename of the AnimationPlayer interface. It leaves a bunch of local variables and helper classes still using the word "player". These will be addressed in subsequent patches that don't require DOM peer review.
This commit is contained in:
parent
99e9a55aac
commit
6033b2c86d
@ -3,9 +3,9 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "AnimationPlayer.h"
|
||||
#include "Animation.h"
|
||||
#include "AnimationUtils.h"
|
||||
#include "mozilla/dom/AnimationPlayerBinding.h"
|
||||
#include "mozilla/dom/AnimationBinding.h"
|
||||
#include "mozilla/AutoRestore.h"
|
||||
#include "AnimationCommon.h" // For AnimationPlayerCollection,
|
||||
// CommonAnimationManager
|
||||
@ -17,23 +17,23 @@
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(AnimationPlayer, mTimeline,
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(Animation, mTimeline,
|
||||
mEffect, mReady, mFinished)
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(AnimationPlayer)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(AnimationPlayer)
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(AnimationPlayer)
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(Animation)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(Animation)
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(Animation)
|
||||
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
JSObject*
|
||||
AnimationPlayer::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
||||
Animation::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
||||
{
|
||||
return dom::AnimationPlayerBinding::Wrap(aCx, this, aGivenProto);
|
||||
return dom::AnimationBinding::Wrap(aCx, this, aGivenProto);
|
||||
}
|
||||
|
||||
void
|
||||
AnimationPlayer::SetStartTime(const Nullable<TimeDuration>& aNewStartTime)
|
||||
Animation::SetStartTime(const Nullable<TimeDuration>& aNewStartTime)
|
||||
{
|
||||
#if 1
|
||||
// Bug 1096776: once we support inactive/missing timelines we'll want to take
|
||||
@ -74,7 +74,7 @@ AnimationPlayer::SetStartTime(const Nullable<TimeDuration>& aNewStartTime)
|
||||
}
|
||||
|
||||
Nullable<TimeDuration>
|
||||
AnimationPlayer::GetCurrentTime() const
|
||||
Animation::GetCurrentTime() const
|
||||
{
|
||||
Nullable<TimeDuration> result;
|
||||
if (!mHoldTime.IsNull()) {
|
||||
@ -94,7 +94,7 @@ AnimationPlayer::GetCurrentTime() const
|
||||
|
||||
// Implements http://w3c.github.io/web-animations/#silently-set-the-current-time
|
||||
void
|
||||
AnimationPlayer::SilentlySetCurrentTime(const TimeDuration& aSeekTime)
|
||||
Animation::SilentlySetCurrentTime(const TimeDuration& aSeekTime)
|
||||
{
|
||||
if (!mHoldTime.IsNull() ||
|
||||
!mTimeline ||
|
||||
@ -115,7 +115,7 @@ AnimationPlayer::SilentlySetCurrentTime(const TimeDuration& aSeekTime)
|
||||
|
||||
// Implements http://w3c.github.io/web-animations/#set-the-current-time
|
||||
void
|
||||
AnimationPlayer::SetCurrentTime(const TimeDuration& aSeekTime)
|
||||
Animation::SetCurrentTime(const TimeDuration& aSeekTime)
|
||||
{
|
||||
SilentlySetCurrentTime(aSeekTime);
|
||||
|
||||
@ -132,7 +132,7 @@ AnimationPlayer::SetCurrentTime(const TimeDuration& aSeekTime)
|
||||
}
|
||||
|
||||
void
|
||||
AnimationPlayer::SetPlaybackRate(double aPlaybackRate)
|
||||
Animation::SetPlaybackRate(double aPlaybackRate)
|
||||
{
|
||||
Nullable<TimeDuration> previousTime = GetCurrentTime();
|
||||
mPlaybackRate = aPlaybackRate;
|
||||
@ -144,7 +144,7 @@ AnimationPlayer::SetPlaybackRate(double aPlaybackRate)
|
||||
}
|
||||
|
||||
void
|
||||
AnimationPlayer::SilentlySetPlaybackRate(double aPlaybackRate)
|
||||
Animation::SilentlySetPlaybackRate(double aPlaybackRate)
|
||||
{
|
||||
Nullable<TimeDuration> previousTime = GetCurrentTime();
|
||||
mPlaybackRate = aPlaybackRate;
|
||||
@ -156,7 +156,7 @@ AnimationPlayer::SilentlySetPlaybackRate(double aPlaybackRate)
|
||||
}
|
||||
|
||||
AnimationPlayState
|
||||
AnimationPlayer::PlayState() const
|
||||
Animation::PlayState() const
|
||||
{
|
||||
if (mPendingState != PendingState::NotPending) {
|
||||
return AnimationPlayState::Pending;
|
||||
@ -190,7 +190,7 @@ CreatePromise(DocumentTimeline* aTimeline, ErrorResult& aRv)
|
||||
}
|
||||
|
||||
Promise*
|
||||
AnimationPlayer::GetReady(ErrorResult& aRv)
|
||||
Animation::GetReady(ErrorResult& aRv)
|
||||
{
|
||||
if (!mReady) {
|
||||
mReady = CreatePromise(mTimeline, aRv); // Lazily create on demand
|
||||
@ -204,7 +204,7 @@ AnimationPlayer::GetReady(ErrorResult& aRv)
|
||||
}
|
||||
|
||||
Promise*
|
||||
AnimationPlayer::GetFinished(ErrorResult& aRv)
|
||||
Animation::GetFinished(ErrorResult& aRv)
|
||||
{
|
||||
if (!mFinished) {
|
||||
mFinished = CreatePromise(mTimeline, aRv); // Lazily create on demand
|
||||
@ -218,14 +218,14 @@ AnimationPlayer::GetFinished(ErrorResult& aRv)
|
||||
}
|
||||
|
||||
void
|
||||
AnimationPlayer::Play(LimitBehavior aLimitBehavior)
|
||||
Animation::Play(LimitBehavior aLimitBehavior)
|
||||
{
|
||||
DoPlay(aLimitBehavior);
|
||||
PostUpdate();
|
||||
}
|
||||
|
||||
void
|
||||
AnimationPlayer::Pause()
|
||||
Animation::Pause()
|
||||
{
|
||||
// TODO: The DoPause() call should not be synchronous (bug 1109390). See
|
||||
// http://w3c.github.io/web-animations/#pausing-an-animation-section
|
||||
@ -234,25 +234,25 @@ AnimationPlayer::Pause()
|
||||
}
|
||||
|
||||
Nullable<double>
|
||||
AnimationPlayer::GetStartTimeAsDouble() const
|
||||
Animation::GetStartTimeAsDouble() const
|
||||
{
|
||||
return AnimationUtils::TimeDurationToDouble(mStartTime);
|
||||
}
|
||||
|
||||
void
|
||||
AnimationPlayer::SetStartTimeAsDouble(const Nullable<double>& aStartTime)
|
||||
Animation::SetStartTimeAsDouble(const Nullable<double>& aStartTime)
|
||||
{
|
||||
return SetStartTime(AnimationUtils::DoubleToTimeDuration(aStartTime));
|
||||
}
|
||||
|
||||
Nullable<double>
|
||||
AnimationPlayer::GetCurrentTimeAsDouble() const
|
||||
Animation::GetCurrentTimeAsDouble() const
|
||||
{
|
||||
return AnimationUtils::TimeDurationToDouble(GetCurrentTime());
|
||||
}
|
||||
|
||||
void
|
||||
AnimationPlayer::SetCurrentTimeAsDouble(const Nullable<double>& aCurrentTime,
|
||||
Animation::SetCurrentTimeAsDouble(const Nullable<double>& aCurrentTime,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
if (aCurrentTime.IsNull()) {
|
||||
@ -266,7 +266,7 @@ AnimationPlayer::SetCurrentTimeAsDouble(const Nullable<double>& aCurrentTime,
|
||||
}
|
||||
|
||||
void
|
||||
AnimationPlayer::SetEffect(KeyframeEffectReadonly* aEffect)
|
||||
Animation::SetEffect(KeyframeEffectReadonly* aEffect)
|
||||
{
|
||||
if (mEffect) {
|
||||
mEffect->SetParentTime(Nullable<TimeDuration>());
|
||||
@ -279,7 +279,7 @@ AnimationPlayer::SetEffect(KeyframeEffectReadonly* aEffect)
|
||||
}
|
||||
|
||||
void
|
||||
AnimationPlayer::Tick()
|
||||
Animation::Tick()
|
||||
{
|
||||
// Since we are not guaranteed to get only one call per refresh driver tick,
|
||||
// it's possible that mPendingReadyTime is set to a time in the future.
|
||||
@ -302,7 +302,7 @@ AnimationPlayer::Tick()
|
||||
}
|
||||
|
||||
void
|
||||
AnimationPlayer::TriggerOnNextTick(const Nullable<TimeDuration>& aReadyTime)
|
||||
Animation::TriggerOnNextTick(const Nullable<TimeDuration>& aReadyTime)
|
||||
{
|
||||
// Normally we expect the play state to be pending but it's possible that,
|
||||
// due to the handling of possibly orphaned players in Tick(), this player got
|
||||
@ -317,7 +317,7 @@ AnimationPlayer::TriggerOnNextTick(const Nullable<TimeDuration>& aReadyTime)
|
||||
}
|
||||
|
||||
void
|
||||
AnimationPlayer::TriggerNow()
|
||||
Animation::TriggerNow()
|
||||
{
|
||||
MOZ_ASSERT(PlayState() == AnimationPlayState::Pending,
|
||||
"Expected to start a pending player");
|
||||
@ -328,7 +328,7 @@ AnimationPlayer::TriggerNow()
|
||||
}
|
||||
|
||||
Nullable<TimeDuration>
|
||||
AnimationPlayer::GetCurrentOrPendingStartTime() const
|
||||
Animation::GetCurrentOrPendingStartTime() const
|
||||
{
|
||||
Nullable<TimeDuration> result;
|
||||
|
||||
@ -349,7 +349,7 @@ AnimationPlayer::GetCurrentOrPendingStartTime() const
|
||||
}
|
||||
|
||||
void
|
||||
AnimationPlayer::Cancel()
|
||||
Animation::Cancel()
|
||||
{
|
||||
if (mPendingState != PendingState::NotPending) {
|
||||
CancelPendingTasks();
|
||||
@ -371,7 +371,7 @@ AnimationPlayer::Cancel()
|
||||
}
|
||||
|
||||
void
|
||||
AnimationPlayer::UpdateRelevance()
|
||||
Animation::UpdateRelevance()
|
||||
{
|
||||
bool wasRelevant = mIsRelevant;
|
||||
mIsRelevant = HasCurrentEffect() || IsInEffect();
|
||||
@ -385,7 +385,7 @@ AnimationPlayer::UpdateRelevance()
|
||||
}
|
||||
|
||||
bool
|
||||
AnimationPlayer::CanThrottle() const
|
||||
Animation::CanThrottle() const
|
||||
{
|
||||
if (!mEffect ||
|
||||
mEffect->IsFinishedTransition() ||
|
||||
@ -410,7 +410,7 @@ AnimationPlayer::CanThrottle() const
|
||||
}
|
||||
|
||||
void
|
||||
AnimationPlayer::ComposeStyle(nsRefPtr<css::AnimValuesStyleRule>& aStyleRule,
|
||||
Animation::ComposeStyle(nsRefPtr<css::AnimValuesStyleRule>& aStyleRule,
|
||||
nsCSSPropertySet& aSetProperties,
|
||||
bool& aNeedsRefreshes)
|
||||
{
|
||||
@ -493,7 +493,7 @@ AnimationPlayer::ComposeStyle(nsRefPtr<css::AnimValuesStyleRule>& aStyleRule,
|
||||
}
|
||||
|
||||
void
|
||||
AnimationPlayer::DoPlay(LimitBehavior aLimitBehavior)
|
||||
Animation::DoPlay(LimitBehavior aLimitBehavior)
|
||||
{
|
||||
bool abortedPause = mPendingState == PendingState::PausePending;
|
||||
|
||||
@ -556,7 +556,7 @@ AnimationPlayer::DoPlay(LimitBehavior aLimitBehavior)
|
||||
}
|
||||
|
||||
void
|
||||
AnimationPlayer::DoPause()
|
||||
Animation::DoPause()
|
||||
{
|
||||
if (IsPausedOrPausing()) {
|
||||
return;
|
||||
@ -593,7 +593,7 @@ AnimationPlayer::DoPause()
|
||||
}
|
||||
|
||||
void
|
||||
AnimationPlayer::ResumeAt(const TimeDuration& aReadyTime)
|
||||
Animation::ResumeAt(const TimeDuration& aReadyTime)
|
||||
{
|
||||
// This method is only expected to be called for a player that is
|
||||
// waiting to play. We can easily adapt it to handle other states
|
||||
@ -625,7 +625,7 @@ AnimationPlayer::ResumeAt(const TimeDuration& aReadyTime)
|
||||
}
|
||||
|
||||
void
|
||||
AnimationPlayer::PauseAt(const TimeDuration& aReadyTime)
|
||||
Animation::PauseAt(const TimeDuration& aReadyTime)
|
||||
{
|
||||
MOZ_ASSERT(mPendingState == PendingState::PausePending,
|
||||
"Expected to pause a pause-pending player");
|
||||
@ -645,7 +645,7 @@ AnimationPlayer::PauseAt(const TimeDuration& aReadyTime)
|
||||
}
|
||||
|
||||
void
|
||||
AnimationPlayer::UpdateTiming()
|
||||
Animation::UpdateTiming()
|
||||
{
|
||||
// We call UpdateFinishedState before UpdateEffect because the former
|
||||
// can change the current time, which is used by the latter.
|
||||
@ -654,7 +654,7 @@ AnimationPlayer::UpdateTiming()
|
||||
}
|
||||
|
||||
void
|
||||
AnimationPlayer::UpdateFinishedState(bool aSeekFlag)
|
||||
Animation::UpdateFinishedState(bool aSeekFlag)
|
||||
{
|
||||
Nullable<TimeDuration> currentTime = GetCurrentTime();
|
||||
TimeDuration effectEnd = TimeDuration(EffectEnd());
|
||||
@ -708,7 +708,7 @@ AnimationPlayer::UpdateFinishedState(bool aSeekFlag)
|
||||
}
|
||||
|
||||
void
|
||||
AnimationPlayer::UpdateEffect()
|
||||
Animation::UpdateEffect()
|
||||
{
|
||||
if (mEffect) {
|
||||
mEffect->SetParentTime(GetCurrentTime());
|
||||
@ -717,7 +717,7 @@ AnimationPlayer::UpdateEffect()
|
||||
}
|
||||
|
||||
void
|
||||
AnimationPlayer::FlushStyle() const
|
||||
Animation::FlushStyle() const
|
||||
{
|
||||
nsIDocument* doc = GetRenderedDocument();
|
||||
if (doc) {
|
||||
@ -726,7 +726,7 @@ AnimationPlayer::FlushStyle() const
|
||||
}
|
||||
|
||||
void
|
||||
AnimationPlayer::PostUpdate()
|
||||
Animation::PostUpdate()
|
||||
{
|
||||
AnimationPlayerCollection* collection = GetCollection();
|
||||
if (collection) {
|
||||
@ -735,7 +735,7 @@ AnimationPlayer::PostUpdate()
|
||||
}
|
||||
|
||||
void
|
||||
AnimationPlayer::CancelPendingTasks()
|
||||
Animation::CancelPendingTasks()
|
||||
{
|
||||
if (mPendingState == PendingState::NotPending) {
|
||||
return;
|
||||
@ -758,7 +758,7 @@ AnimationPlayer::CancelPendingTasks()
|
||||
}
|
||||
|
||||
bool
|
||||
AnimationPlayer::IsFinished() const
|
||||
Animation::IsFinished() const
|
||||
{
|
||||
// Unfortunately there's some weirdness in the spec at the moment where if
|
||||
// you're finished and paused, the playState is paused. This prevents us
|
||||
@ -771,7 +771,7 @@ AnimationPlayer::IsFinished() const
|
||||
}
|
||||
|
||||
bool
|
||||
AnimationPlayer::IsPossiblyOrphanedPendingPlayer() const
|
||||
Animation::IsPossiblyOrphanedPendingPlayer() const
|
||||
{
|
||||
// Check if we are pending but might never start because we are not being
|
||||
// tracked.
|
||||
@ -825,7 +825,7 @@ AnimationPlayer::IsPossiblyOrphanedPendingPlayer() const
|
||||
}
|
||||
|
||||
StickyTimeDuration
|
||||
AnimationPlayer::EffectEnd() const
|
||||
Animation::EffectEnd() const
|
||||
{
|
||||
if (!mEffect) {
|
||||
return StickyTimeDuration(0);
|
||||
@ -836,7 +836,7 @@ AnimationPlayer::EffectEnd() const
|
||||
}
|
||||
|
||||
nsIDocument*
|
||||
AnimationPlayer::GetRenderedDocument() const
|
||||
Animation::GetRenderedDocument() const
|
||||
{
|
||||
if (!mEffect) {
|
||||
return nullptr;
|
||||
@ -853,7 +853,7 @@ AnimationPlayer::GetRenderedDocument() const
|
||||
}
|
||||
|
||||
nsPresContext*
|
||||
AnimationPlayer::GetPresContext() const
|
||||
Animation::GetPresContext() const
|
||||
{
|
||||
nsIDocument* doc = GetRenderedDocument();
|
||||
if (!doc) {
|
||||
@ -867,7 +867,7 @@ AnimationPlayer::GetPresContext() const
|
||||
}
|
||||
|
||||
AnimationPlayerCollection*
|
||||
AnimationPlayer::GetCollection() const
|
||||
Animation::GetCollection() const
|
||||
{
|
||||
css::CommonAnimationManager* manager = GetAnimationManager();
|
||||
if (!manager) {
|
@ -3,14 +3,14 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef mozilla_dom_AnimationPlayer_h
|
||||
#define mozilla_dom_AnimationPlayer_h
|
||||
#ifndef mozilla_dom_Animation_h
|
||||
#define mozilla_dom_Animation_h
|
||||
|
||||
#include "nsWrapperCache.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/TimeStamp.h" // for TimeStamp, TimeDuration
|
||||
#include "mozilla/dom/AnimationPlayerBinding.h" // for AnimationPlayState
|
||||
#include "mozilla/dom/AnimationBinding.h" // for AnimationPlayState
|
||||
#include "mozilla/dom/DocumentTimeline.h" // for DocumentTimeline
|
||||
#include "mozilla/dom/KeyframeEffect.h" // for KeyframeEffectReadonly
|
||||
#include "mozilla/dom/Promise.h" // for Promise
|
||||
@ -44,14 +44,15 @@ class CSSTransitionPlayer;
|
||||
|
||||
namespace dom {
|
||||
|
||||
class AnimationPlayer : public nsISupports,
|
||||
public nsWrapperCache
|
||||
class Animation
|
||||
: public nsISupports
|
||||
, public nsWrapperCache
|
||||
{
|
||||
protected:
|
||||
virtual ~AnimationPlayer() {}
|
||||
virtual ~Animation() {}
|
||||
|
||||
public:
|
||||
explicit AnimationPlayer(DocumentTimeline* aTimeline)
|
||||
explicit Animation(DocumentTimeline* aTimeline)
|
||||
: mTimeline(aTimeline)
|
||||
, mPlaybackRate(1.0)
|
||||
, mPendingState(PendingState::NotPending)
|
||||
@ -63,7 +64,7 @@ public:
|
||||
}
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(AnimationPlayer)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Animation)
|
||||
|
||||
DocumentTimeline* GetParentObject() const { return mTimeline; }
|
||||
virtual JSObject* WrapObject(JSContext* aCx,
|
||||
@ -79,7 +80,7 @@ public:
|
||||
Continue = 1
|
||||
};
|
||||
|
||||
// AnimationPlayer methods
|
||||
// Animation methods
|
||||
KeyframeEffectReadonly* GetEffect() const { return mEffect; }
|
||||
DocumentTimeline* Timeline() const { return mTimeline; }
|
||||
Nullable<TimeDuration> GetStartTime() const { return mStartTime; }
|
||||
@ -97,7 +98,7 @@ public:
|
||||
virtual void Pause();
|
||||
bool IsRunningOnCompositor() const { return mIsRunningOnCompositor; }
|
||||
|
||||
// Wrapper functions for AnimationPlayer DOM methods when called
|
||||
// Wrapper functions for Animation DOM methods when called
|
||||
// from script. We often use the same methods internally and from
|
||||
// script but when called from script we (or one of our subclasses) perform
|
||||
// extra steps such as flushing style or converting the return type.
|
||||
@ -346,4 +347,4 @@ protected:
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // mozilla_dom_AnimationPlayer_h
|
||||
#endif // mozilla_dom_Animation_h
|
@ -234,7 +234,7 @@ KeyframeEffectReadonly::ActiveDuration(const AnimationTiming& aTiming)
|
||||
|
||||
// http://w3c.github.io/web-animations/#in-play
|
||||
bool
|
||||
KeyframeEffectReadonly::IsInPlay(const AnimationPlayer& aPlayer) const
|
||||
KeyframeEffectReadonly::IsInPlay(const Animation& aPlayer) const
|
||||
{
|
||||
if (IsFinishedTransition() ||
|
||||
aPlayer.PlayState() == AnimationPlayState::Finished) {
|
||||
@ -246,7 +246,7 @@ KeyframeEffectReadonly::IsInPlay(const AnimationPlayer& aPlayer) const
|
||||
|
||||
// http://w3c.github.io/web-animations/#current
|
||||
bool
|
||||
KeyframeEffectReadonly::IsCurrent(const AnimationPlayer& aPlayer) const
|
||||
KeyframeEffectReadonly::IsCurrent(const Animation& aPlayer) const
|
||||
{
|
||||
if (IsFinishedTransition() ||
|
||||
aPlayer.PlayState() == AnimationPlayState::Finished) {
|
||||
|
@ -306,8 +306,8 @@ public:
|
||||
mIsFinishedTransition = aIsFinished;
|
||||
}
|
||||
|
||||
bool IsInPlay(const AnimationPlayer& aPlayer) const;
|
||||
bool IsCurrent(const AnimationPlayer& aPlayer) const;
|
||||
bool IsInPlay(const Animation& aPlayer) const;
|
||||
bool IsCurrent(const Animation& aPlayer) const;
|
||||
bool IsInEffect() const;
|
||||
|
||||
const AnimationProperty*
|
||||
|
@ -22,7 +22,7 @@ NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(PendingPlayerTracker, AddRef)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(PendingPlayerTracker, Release)
|
||||
|
||||
void
|
||||
PendingPlayerTracker::AddPending(dom::AnimationPlayer& aPlayer,
|
||||
PendingPlayerTracker::AddPending(dom::Animation& aPlayer,
|
||||
AnimationPlayerSet& aSet)
|
||||
{
|
||||
aSet.PutEntry(&aPlayer);
|
||||
@ -34,24 +34,24 @@ PendingPlayerTracker::AddPending(dom::AnimationPlayer& aPlayer,
|
||||
}
|
||||
|
||||
void
|
||||
PendingPlayerTracker::RemovePending(dom::AnimationPlayer& aPlayer,
|
||||
PendingPlayerTracker::RemovePending(dom::Animation& aPlayer,
|
||||
AnimationPlayerSet& aSet)
|
||||
{
|
||||
aSet.RemoveEntry(&aPlayer);
|
||||
}
|
||||
|
||||
bool
|
||||
PendingPlayerTracker::IsWaiting(const dom::AnimationPlayer& aPlayer,
|
||||
PendingPlayerTracker::IsWaiting(const dom::Animation& aPlayer,
|
||||
const AnimationPlayerSet& aSet) const
|
||||
{
|
||||
return aSet.Contains(const_cast<dom::AnimationPlayer*>(&aPlayer));
|
||||
return aSet.Contains(const_cast<dom::Animation*>(&aPlayer));
|
||||
}
|
||||
|
||||
PLDHashOperator
|
||||
TriggerPlayerAtTime(nsRefPtrHashKey<dom::AnimationPlayer>* aKey,
|
||||
TriggerPlayerAtTime(nsRefPtrHashKey<dom::Animation>* aKey,
|
||||
void* aReadyTime)
|
||||
{
|
||||
dom::AnimationPlayer* player = aKey->GetKey();
|
||||
dom::Animation* player = aKey->GetKey();
|
||||
dom::DocumentTimeline* timeline = player->Timeline();
|
||||
|
||||
// When the timeline's refresh driver is under test control, its values
|
||||
@ -81,7 +81,7 @@ PendingPlayerTracker::TriggerPendingPlayersOnNextTick(const TimeStamp&
|
||||
}
|
||||
|
||||
PLDHashOperator
|
||||
TriggerPlayerNow(nsRefPtrHashKey<dom::AnimationPlayer>* aKey, void*)
|
||||
TriggerPlayerNow(nsRefPtrHashKey<dom::Animation>* aKey, void*)
|
||||
{
|
||||
aKey->GetKey()->TriggerNow();
|
||||
return PL_DHASH_NEXT;
|
||||
|
@ -6,7 +6,7 @@
|
||||
#ifndef mozilla_dom_PendingPlayerTracker_h
|
||||
#define mozilla_dom_PendingPlayerTracker_h
|
||||
|
||||
#include "mozilla/dom/AnimationPlayer.h"
|
||||
#include "mozilla/dom/Animation.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsTHashtable.h"
|
||||
@ -25,32 +25,32 @@ public:
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(PendingPlayerTracker)
|
||||
NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(PendingPlayerTracker)
|
||||
|
||||
void AddPlayPending(dom::AnimationPlayer& aPlayer)
|
||||
void AddPlayPending(dom::Animation& aPlayer)
|
||||
{
|
||||
MOZ_ASSERT(!IsWaitingToPause(aPlayer),
|
||||
"Player is already waiting to pause");
|
||||
AddPending(aPlayer, mPlayPendingSet);
|
||||
}
|
||||
void RemovePlayPending(dom::AnimationPlayer& aPlayer)
|
||||
void RemovePlayPending(dom::Animation& aPlayer)
|
||||
{
|
||||
RemovePending(aPlayer, mPlayPendingSet);
|
||||
}
|
||||
bool IsWaitingToPlay(const dom::AnimationPlayer& aPlayer) const
|
||||
bool IsWaitingToPlay(const dom::Animation& aPlayer) const
|
||||
{
|
||||
return IsWaiting(aPlayer, mPlayPendingSet);
|
||||
}
|
||||
|
||||
void AddPausePending(dom::AnimationPlayer& aPlayer)
|
||||
void AddPausePending(dom::Animation& aPlayer)
|
||||
{
|
||||
MOZ_ASSERT(!IsWaitingToPlay(aPlayer),
|
||||
"Player is already waiting to play");
|
||||
AddPending(aPlayer, mPausePendingSet);
|
||||
}
|
||||
void RemovePausePending(dom::AnimationPlayer& aPlayer)
|
||||
void RemovePausePending(dom::Animation& aPlayer)
|
||||
{
|
||||
RemovePending(aPlayer, mPausePendingSet);
|
||||
}
|
||||
bool IsWaitingToPause(const dom::AnimationPlayer& aPlayer) const
|
||||
bool IsWaitingToPause(const dom::Animation& aPlayer) const
|
||||
{
|
||||
return IsWaiting(aPlayer, mPausePendingSet);
|
||||
}
|
||||
@ -66,14 +66,14 @@ private:
|
||||
|
||||
void EnsurePaintIsScheduled();
|
||||
|
||||
typedef nsTHashtable<nsRefPtrHashKey<dom::AnimationPlayer>>
|
||||
typedef nsTHashtable<nsRefPtrHashKey<dom::Animation>>
|
||||
AnimationPlayerSet;
|
||||
|
||||
void AddPending(dom::AnimationPlayer& aPlayer,
|
||||
void AddPending(dom::Animation& aPlayer,
|
||||
AnimationPlayerSet& aSet);
|
||||
void RemovePending(dom::AnimationPlayer& aPlayer,
|
||||
void RemovePending(dom::Animation& aPlayer,
|
||||
AnimationPlayerSet& aSet);
|
||||
bool IsWaiting(const dom::AnimationPlayer& aPlayer,
|
||||
bool IsWaiting(const dom::Animation& aPlayer,
|
||||
const AnimationPlayerSet& aSet) const;
|
||||
|
||||
AnimationPlayerSet mPlayPendingSet;
|
||||
|
@ -8,8 +8,8 @@ MOCHITEST_MANIFESTS += ['test/mochitest.ini']
|
||||
MOCHITEST_CHROME_MANIFESTS += ['test/chrome.ini']
|
||||
|
||||
EXPORTS.mozilla.dom += [
|
||||
'Animation.h',
|
||||
'AnimationEffectReadonly.h',
|
||||
'AnimationPlayer.h',
|
||||
'AnimationTimeline.h',
|
||||
'DocumentTimeline.h',
|
||||
'KeyframeEffect.h',
|
||||
@ -21,8 +21,8 @@ EXPORTS.mozilla += [
|
||||
]
|
||||
|
||||
UNIFIED_SOURCES += [
|
||||
'Animation.cpp',
|
||||
'AnimationEffectReadonly.cpp',
|
||||
'AnimationPlayer.cpp',
|
||||
'AnimationTimeline.cpp',
|
||||
'DocumentTimeline.cpp',
|
||||
'KeyframeEffect.cpp',
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
#include "AnimationCommon.h"
|
||||
#include "mozilla/DebugOnly.h"
|
||||
#include "mozilla/dom/AnimationPlayer.h"
|
||||
#include "mozilla/dom/Animation.h"
|
||||
#include "mozilla/dom/Attr.h"
|
||||
#include "nsDOMAttributeMap.h"
|
||||
#include "nsIAtom.h"
|
||||
@ -3186,7 +3186,7 @@ Element::MozRequestPointerLock()
|
||||
}
|
||||
|
||||
void
|
||||
Element::GetAnimations(nsTArray<nsRefPtr<AnimationPlayer> >& aAnimations)
|
||||
Element::GetAnimations(nsTArray<nsRefPtr<Animation>>& aAnimations)
|
||||
{
|
||||
nsIDocument* doc = GetComposedDoc();
|
||||
if (doc) {
|
||||
@ -3206,7 +3206,7 @@ Element::GetAnimations(nsTArray<nsRefPtr<AnimationPlayer> >& aAnimations)
|
||||
for (size_t playerIdx = 0;
|
||||
playerIdx < collection->mPlayers.Length();
|
||||
playerIdx++) {
|
||||
AnimationPlayer* player = collection->mPlayers[playerIdx];
|
||||
Animation* player = collection->mPlayers[playerIdx];
|
||||
if (player->IsRelevant()) {
|
||||
aAnimations.AppendElement(player);
|
||||
}
|
||||
|
@ -121,7 +121,7 @@ class EventStateManager;
|
||||
|
||||
namespace dom {
|
||||
|
||||
class AnimationPlayer;
|
||||
class Animation;
|
||||
class Link;
|
||||
class UndoManager;
|
||||
class DOMRect;
|
||||
@ -808,7 +808,7 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
void GetAnimations(nsTArray<nsRefPtr<AnimationPlayer> >& aAnimations);
|
||||
void GetAnimations(nsTArray<nsRefPtr<Animation>>& aAnimations);
|
||||
|
||||
NS_IMETHOD GetInnerHTML(nsAString& aInnerHTML);
|
||||
virtual void SetInnerHTML(const nsAString& aInnerHTML, ErrorResult& aError);
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include "nsIDOMMutationEvent.h"
|
||||
#include "nsTextFragment.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "mozilla/dom/AnimationPlayer.h"
|
||||
#include "mozilla/dom/Animation.h"
|
||||
#include "mozilla/dom/KeyframeEffect.h"
|
||||
|
||||
nsAutoTArray<nsRefPtr<nsDOMMutationObserver>, 4>*
|
||||
@ -325,7 +325,7 @@ void nsMutationReceiver::NodeWillBeDestroyed(const nsINode *aNode)
|
||||
}
|
||||
|
||||
void
|
||||
nsAnimationReceiver::RecordAnimationMutation(AnimationPlayer* aPlayer,
|
||||
nsAnimationReceiver::RecordAnimationMutation(Animation* aPlayer,
|
||||
AnimationMutation aMutationType)
|
||||
{
|
||||
KeyframeEffectReadonly* effect = aPlayer->GetEffect();
|
||||
@ -385,19 +385,19 @@ nsAnimationReceiver::RecordAnimationMutation(AnimationPlayer* aPlayer,
|
||||
}
|
||||
|
||||
void
|
||||
nsAnimationReceiver::AnimationAdded(AnimationPlayer* aPlayer)
|
||||
nsAnimationReceiver::AnimationAdded(Animation* aPlayer)
|
||||
{
|
||||
RecordAnimationMutation(aPlayer, eAnimationMutation_Added);
|
||||
}
|
||||
|
||||
void
|
||||
nsAnimationReceiver::AnimationChanged(AnimationPlayer* aPlayer)
|
||||
nsAnimationReceiver::AnimationChanged(Animation* aPlayer)
|
||||
{
|
||||
RecordAnimationMutation(aPlayer, eAnimationMutation_Changed);
|
||||
}
|
||||
|
||||
void
|
||||
nsAnimationReceiver::AnimationRemoved(AnimationPlayer* aPlayer)
|
||||
nsAnimationReceiver::AnimationRemoved(Animation* aPlayer)
|
||||
{
|
||||
RecordAnimationMutation(aPlayer, eAnimationMutation_Removed);
|
||||
}
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include "nsWrapperCache.h"
|
||||
#include "mozilla/dom/MutationObserverBinding.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "mozilla/dom/AnimationPlayer.h"
|
||||
#include "mozilla/dom/Animation.h"
|
||||
#include "nsIAnimationObserver.h"
|
||||
|
||||
class nsDOMMutationObserver;
|
||||
@ -36,7 +36,7 @@ class nsDOMMutationRecord final : public nsISupports,
|
||||
virtual ~nsDOMMutationRecord() {}
|
||||
|
||||
public:
|
||||
typedef nsTArray<nsRefPtr<mozilla::dom::AnimationPlayer>> AnimationPlayerArray;
|
||||
typedef nsTArray<nsRefPtr<mozilla::dom::Animation>> AnimationPlayerArray;
|
||||
|
||||
nsDOMMutationRecord(nsIAtom* aType, nsISupports* aOwner)
|
||||
: mType(aType), mAttrNamespace(NullString()), mPrevValue(NullString()), mOwner(aOwner)
|
||||
@ -434,7 +434,7 @@ private:
|
||||
eAnimationMutation_Removed
|
||||
};
|
||||
|
||||
void RecordAnimationMutation(mozilla::dom::AnimationPlayer* aPlayer,
|
||||
void RecordAnimationMutation(mozilla::dom::Animation* aPlayer,
|
||||
AnimationMutation aMutationType);
|
||||
};
|
||||
|
||||
@ -756,7 +756,7 @@ public:
|
||||
return sCurrentBatch->mBatchTarget;
|
||||
}
|
||||
|
||||
static void AnimationAdded(mozilla::dom::AnimationPlayer* aPlayer)
|
||||
static void AnimationAdded(mozilla::dom::Animation* aPlayer)
|
||||
{
|
||||
if (!IsBatching()) {
|
||||
return;
|
||||
@ -783,7 +783,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
static void AnimationChanged(mozilla::dom::AnimationPlayer* aPlayer)
|
||||
static void AnimationChanged(mozilla::dom::Animation* aPlayer)
|
||||
{
|
||||
Entry* entry = sCurrentBatch->FindEntry(aPlayer);
|
||||
if (entry) {
|
||||
@ -800,7 +800,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
static void AnimationRemoved(mozilla::dom::AnimationPlayer* aPlayer)
|
||||
static void AnimationRemoved(mozilla::dom::Animation* aPlayer)
|
||||
{
|
||||
Entry* entry = sCurrentBatch->FindEntry(aPlayer);
|
||||
if (entry) {
|
||||
@ -824,7 +824,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
Entry* FindEntry(mozilla::dom::AnimationPlayer* aPlayer)
|
||||
Entry* FindEntry(mozilla::dom::Animation* aPlayer)
|
||||
{
|
||||
for (Entry& e : mEntries) {
|
||||
if (e.mPlayer == aPlayer) {
|
||||
@ -843,7 +843,7 @@ private:
|
||||
|
||||
struct Entry
|
||||
{
|
||||
nsRefPtr<mozilla::dom::AnimationPlayer> mPlayer;
|
||||
nsRefPtr<mozilla::dom::Animation> mPlayer;
|
||||
State mState;
|
||||
bool mChanged;
|
||||
};
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
class AnimationPlayer;
|
||||
class Animation;
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,36 +22,36 @@ class nsIAnimationObserver : public nsIMutationObserver
|
||||
public:
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IANIMATION_OBSERVER_IID)
|
||||
|
||||
virtual void AnimationAdded(mozilla::dom::AnimationPlayer* aPlayer) = 0;
|
||||
virtual void AnimationChanged(mozilla::dom::AnimationPlayer* aPlayer) = 0;
|
||||
virtual void AnimationRemoved(mozilla::dom::AnimationPlayer* aPlayer) = 0;
|
||||
virtual void AnimationAdded(mozilla::dom::Animation* aPlayer) = 0;
|
||||
virtual void AnimationChanged(mozilla::dom::Animation* aPlayer) = 0;
|
||||
virtual void AnimationRemoved(mozilla::dom::Animation* aPlayer) = 0;
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsIAnimationObserver, NS_IANIMATION_OBSERVER_IID)
|
||||
|
||||
#define NS_DECL_NSIANIMATIONOBSERVER_ANIMATIONADDED \
|
||||
virtual void AnimationAdded(mozilla::dom::AnimationPlayer* aPlayer) \
|
||||
virtual void AnimationAdded(mozilla::dom::Animation* aPlayer) \
|
||||
override;
|
||||
|
||||
#define NS_DECL_NSIANIMATIONOBSERVER_ANIMATIONCHANGED \
|
||||
virtual void AnimationChanged(mozilla::dom::AnimationPlayer* aPlayer) \
|
||||
virtual void AnimationChanged(mozilla::dom::Animation* aPlayer) \
|
||||
override;
|
||||
|
||||
#define NS_DECL_NSIANIMATIONOBSERVER_ANIMATIONREMOVED \
|
||||
virtual void AnimationRemoved(mozilla::dom::AnimationPlayer* aPlayer) \
|
||||
virtual void AnimationRemoved(mozilla::dom::Animation* aPlayer) \
|
||||
override;
|
||||
|
||||
#define NS_IMPL_NSIANIMATIONOBSERVER_STUB(class_) \
|
||||
void \
|
||||
class_::AnimationAdded(mozilla::dom::AnimationPlayer* aPlayer) \
|
||||
class_::AnimationAdded(mozilla::dom::Animation* aPlayer) \
|
||||
{ \
|
||||
} \
|
||||
void \
|
||||
class_::AnimationChanged(mozilla::dom::AnimationPlayer* aPlayer) \
|
||||
class_::AnimationChanged(mozilla::dom::Animation* aPlayer) \
|
||||
{ \
|
||||
} \
|
||||
void \
|
||||
class_::AnimationRemoved(mozilla::dom::AnimationPlayer* aPlayer) \
|
||||
class_::AnimationRemoved(mozilla::dom::Animation* aPlayer) \
|
||||
{ \
|
||||
} \
|
||||
NS_IMPL_NSIMUTATIONOBSERVER_CORE_STUB(class_) \
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include "nsBindingManager.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/dom/AnimationPlayer.h"
|
||||
#include "mozilla/dom/Animation.h"
|
||||
#include "mozilla/dom/HTMLImageElement.h"
|
||||
#include "mozilla/dom/HTMLMediaElement.h"
|
||||
#include "mozilla/dom/KeyframeEffect.h"
|
||||
@ -216,7 +216,7 @@ nsNodeUtils::ContentRemoved(nsINode* aContainer,
|
||||
}
|
||||
|
||||
static inline Element*
|
||||
GetTarget(AnimationPlayer* aPlayer)
|
||||
GetTarget(Animation* aPlayer)
|
||||
{
|
||||
KeyframeEffectReadonly* effect = aPlayer->GetEffect();
|
||||
if (!effect) {
|
||||
@ -238,7 +238,7 @@ GetTarget(AnimationPlayer* aPlayer)
|
||||
}
|
||||
|
||||
void
|
||||
nsNodeUtils::AnimationAdded(AnimationPlayer* aPlayer)
|
||||
nsNodeUtils::AnimationAdded(Animation* aPlayer)
|
||||
{
|
||||
Element* target = GetTarget(aPlayer);
|
||||
if (!target) {
|
||||
@ -252,7 +252,7 @@ nsNodeUtils::AnimationAdded(AnimationPlayer* aPlayer)
|
||||
}
|
||||
|
||||
void
|
||||
nsNodeUtils::AnimationChanged(AnimationPlayer* aPlayer)
|
||||
nsNodeUtils::AnimationChanged(Animation* aPlayer)
|
||||
{
|
||||
Element* target = GetTarget(aPlayer);
|
||||
if (!target) {
|
||||
@ -266,7 +266,7 @@ nsNodeUtils::AnimationChanged(AnimationPlayer* aPlayer)
|
||||
}
|
||||
|
||||
void
|
||||
nsNodeUtils::AnimationRemoved(AnimationPlayer* aPlayer)
|
||||
nsNodeUtils::AnimationRemoved(Animation* aPlayer)
|
||||
{
|
||||
Element* target = GetTarget(aPlayer);
|
||||
if (!target) {
|
||||
|
@ -18,7 +18,7 @@ template<class E> class nsCOMArray;
|
||||
class nsCycleCollectionTraversalCallback;
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
class AnimationPlayer;
|
||||
class Animation;
|
||||
}
|
||||
}
|
||||
|
||||
@ -127,9 +127,9 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
static void AnimationAdded(mozilla::dom::AnimationPlayer* aPlayer);
|
||||
static void AnimationChanged(mozilla::dom::AnimationPlayer* aPlayer);
|
||||
static void AnimationRemoved(mozilla::dom::AnimationPlayer* aPlayer);
|
||||
static void AnimationAdded(mozilla::dom::Animation* aPlayer);
|
||||
static void AnimationChanged(mozilla::dom::Animation* aPlayer);
|
||||
static void AnimationRemoved(mozilla::dom::Animation* aPlayer);
|
||||
|
||||
/**
|
||||
* To be called when reference count of aNode drops to zero.
|
||||
|
@ -129,12 +129,12 @@ var interfaceNamesInGlobalScope =
|
||||
{name: "AlarmsManager", pref: "dom.mozAlarms.enabled"},
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
"AnalyserNode",
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
{name: "Animation", pref: "dom.animations-api.core.enabled"},
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
{name: "AnimationEffectReadonly", pref: "dom.animations-api.core.enabled"},
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
"AnimationEvent",
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
{name: "AnimationPlayer", pref: "dom.animations-api.core.enabled"},
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
{name: "AnimationTimeline", pref: "dom.animations-api.core.enabled"},
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
|
@ -13,5 +13,5 @@
|
||||
[NoInterfaceObject]
|
||||
interface Animatable {
|
||||
[Func="nsDocument::IsWebAnimationsEnabled"]
|
||||
sequence<AnimationPlayer> getAnimations();
|
||||
sequence<Animation> getAnimations();
|
||||
};
|
||||
|
@ -4,16 +4,16 @@
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* http://dev.w3.org/fxtf/web-animations/#idl-def-AnimationPlayer
|
||||
* http://w3c.github.io/web-animations/#the-animation-interface
|
||||
*
|
||||
* Copyright © 2014 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
|
||||
* Copyright © 2015 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
|
||||
* liability, trademark and document use rules apply.
|
||||
*/
|
||||
|
||||
enum AnimationPlayState { "idle", "pending", "running", "paused", "finished" };
|
||||
|
||||
[Func="nsDocument::IsWebAnimationsEnabled"]
|
||||
interface AnimationPlayer {
|
||||
interface Animation {
|
||||
// Bug 1049975: Make 'effect' writeable
|
||||
[Pure]
|
||||
readonly attribute AnimationEffectReadonly? effect;
|
||||
@ -27,9 +27,9 @@ interface AnimationPlayer {
|
||||
[BinaryName="playStateFromJS"]
|
||||
readonly attribute AnimationPlayState playState;
|
||||
[Throws]
|
||||
readonly attribute Promise<AnimationPlayer> ready;
|
||||
readonly attribute Promise<Animation> ready;
|
||||
[Throws]
|
||||
readonly attribute Promise<AnimationPlayer> finished;
|
||||
readonly attribute Promise<Animation> finished;
|
||||
/*
|
||||
void cancel ();
|
||||
void finish ();
|
||||
@ -44,6 +44,6 @@ interface AnimationPlayer {
|
||||
};
|
||||
|
||||
// Non-standard extensions
|
||||
partial interface AnimationPlayer {
|
||||
partial interface Animation {
|
||||
[ChromeOnly] readonly attribute boolean isRunningOnCompositor;
|
||||
};
|
@ -15,6 +15,6 @@ interface AnimationTimeline {
|
||||
[BinaryName="currentTimeAsDouble"]
|
||||
readonly attribute double? currentTime;
|
||||
// Not yet implemented:
|
||||
// AnimationPlayer play (optional TimedItem? source = null);
|
||||
// sequence<AnimationPlayer> getAnimations ();
|
||||
// Animation play (optional TimedItem? source = null);
|
||||
// sequence<Animation> getAnimations ();
|
||||
};
|
||||
|
@ -29,11 +29,11 @@ interface MutationRecord {
|
||||
[Constant]
|
||||
readonly attribute DOMString? oldValue;
|
||||
[Constant,Cached,ChromeOnly]
|
||||
readonly attribute sequence<AnimationPlayer> addedAnimations;
|
||||
readonly attribute sequence<Animation> addedAnimations;
|
||||
[Constant,Cached,ChromeOnly]
|
||||
readonly attribute sequence<AnimationPlayer> changedAnimations;
|
||||
readonly attribute sequence<Animation> changedAnimations;
|
||||
[Constant,Cached,ChromeOnly]
|
||||
readonly attribute sequence<AnimationPlayer> removedAnimations;
|
||||
readonly attribute sequence<Animation> removedAnimations;
|
||||
};
|
||||
|
||||
[Constructor(MutationCallback mutationCallback)]
|
||||
|
@ -22,9 +22,9 @@ WEBIDL_FILES = [
|
||||
'AlarmsManager.webidl',
|
||||
'AnalyserNode.webidl',
|
||||
'Animatable.webidl',
|
||||
'Animation.webidl',
|
||||
'AnimationEffectReadonly.webidl',
|
||||
'AnimationEvent.webidl',
|
||||
'AnimationPlayer.webidl',
|
||||
'AnimationTimeline.webidl',
|
||||
'AnonymousContent.webidl',
|
||||
'AppInfo.webidl',
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "gfx2DGlue.h"
|
||||
#include "mozilla/DebugOnly.h" // for DebugOnly
|
||||
#include "mozilla/Telemetry.h" // for Accumulate
|
||||
#include "mozilla/dom/AnimationPlayer.h" // for ComputedTimingFunction
|
||||
#include "mozilla/dom/Animation.h" // for ComputedTimingFunction
|
||||
#include "mozilla/gfx/2D.h" // for DrawTarget
|
||||
#include "mozilla/gfx/BaseSize.h" // for BaseSize
|
||||
#include "mozilla/gfx/Matrix.h" // for Matrix4x4
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include "mozilla/ReentrantMonitor.h" // for ReentrantMonitorAutoEnter, etc
|
||||
#include "mozilla/StaticPtr.h" // for StaticAutoPtr
|
||||
#include "mozilla/TimeStamp.h" // for TimeDuration, TimeStamp
|
||||
#include "mozilla/dom/AnimationPlayer.h" // for ComputedTimingFunction
|
||||
#include "mozilla/dom/KeyframeEffect.h" // for ComputedTimingFunction
|
||||
#include "mozilla/dom/Touch.h" // for Touch
|
||||
#include "mozilla/gfx/BasePoint.h" // for BasePoint
|
||||
#include "mozilla/gfx/BaseRect.h" // for BaseRect
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include <math.h> // for fabsf, pow, powf
|
||||
#include <algorithm> // for max
|
||||
#include "AsyncPanZoomController.h" // for AsyncPanZoomController
|
||||
#include "mozilla/dom/AnimationPlayer.h" // for ComputedTimingFunction
|
||||
#include "mozilla/dom/KeyframeEffect.h" // for ComputedTimingFunction
|
||||
#include "mozilla/layers/APZCTreeManager.h" // for APZCTreeManager
|
||||
#include "mozilla/layers/APZThreadUtils.h" // for AssertOnControllerThread
|
||||
#include "FrameMetrics.h" // for FrameMetrics
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "nsIContent.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsRefreshDriver.h"
|
||||
|
||||
#define APZCCH_LOG(...)
|
||||
// #define APZCCH_LOG(...) printf_stderr("APZCCH: " __VA_ARGS__)
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include "gfxPoint.h" // for gfxPoint, gfxSize
|
||||
#include "mozilla/StyleAnimationValue.h" // for StyleAnimationValue, etc
|
||||
#include "mozilla/WidgetUtils.h" // for ComputeTransformForRotation
|
||||
#include "mozilla/dom/AnimationPlayer.h" // for AnimationPlayer
|
||||
#include "mozilla/dom/KeyframeEffect.h" // for KeyframeEffectReadonly
|
||||
#include "mozilla/gfx/BaseRect.h" // for BaseRect
|
||||
#include "mozilla/gfx/Point.h" // for RoundedToInt, PointTyped
|
||||
|
@ -348,7 +348,7 @@ ToTimingFunction(const ComputedTimingFunction& aCTF)
|
||||
|
||||
static void
|
||||
AddAnimationForProperty(nsIFrame* aFrame, const AnimationProperty& aProperty,
|
||||
AnimationPlayer* aPlayer, Layer* aLayer,
|
||||
dom::Animation* aPlayer, Layer* aLayer,
|
||||
AnimationData& aData, bool aPending)
|
||||
{
|
||||
MOZ_ASSERT(aLayer->AsContainerLayer(), "Should only animate ContainerLayer");
|
||||
@ -417,7 +417,7 @@ AddAnimationsForProperty(nsIFrame* aFrame, nsCSSProperty aProperty,
|
||||
|
||||
// Add from first to last (since last overrides)
|
||||
for (size_t playerIdx = 0; playerIdx < aPlayers.Length(); playerIdx++) {
|
||||
AnimationPlayer* player = aPlayers[playerIdx];
|
||||
dom::Animation* player = aPlayers[playerIdx];
|
||||
if (!player->IsPlaying()) {
|
||||
continue;
|
||||
}
|
||||
|
@ -501,7 +501,7 @@ GetMinAndMaxScaleForAnimationProperty(nsIContent* aContent,
|
||||
gfxSize& aMinScale)
|
||||
{
|
||||
for (size_t playerIdx = aPlayers->mPlayers.Length(); playerIdx-- != 0; ) {
|
||||
AnimationPlayer* player = aPlayers->mPlayers[playerIdx];
|
||||
dom::Animation* player = aPlayers->mPlayers[playerIdx];
|
||||
if (!player->GetEffect() || player->GetEffect()->IsFinishedTransition()) {
|
||||
continue;
|
||||
}
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
|
||||
using mozilla::layers::Layer;
|
||||
using mozilla::dom::AnimationPlayer;
|
||||
using mozilla::dom::Animation;
|
||||
using mozilla::dom::KeyframeEffectReadonly;
|
||||
|
||||
namespace mozilla {
|
||||
@ -601,7 +601,7 @@ AnimationPlayerCollection::CanPerformOnCompositorThread(
|
||||
}
|
||||
|
||||
for (size_t playerIdx = mPlayers.Length(); playerIdx-- != 0; ) {
|
||||
const AnimationPlayer* player = mPlayers[playerIdx];
|
||||
const Animation* player = mPlayers[playerIdx];
|
||||
if (!player->IsPlaying()) {
|
||||
continue;
|
||||
}
|
||||
@ -620,7 +620,7 @@ AnimationPlayerCollection::CanPerformOnCompositorThread(
|
||||
|
||||
bool existsProperty = false;
|
||||
for (size_t playerIdx = mPlayers.Length(); playerIdx-- != 0; ) {
|
||||
const AnimationPlayer* player = mPlayers[playerIdx];
|
||||
const Animation* player = mPlayers[playerIdx];
|
||||
if (!player->IsPlaying()) {
|
||||
continue;
|
||||
}
|
||||
@ -928,7 +928,7 @@ AnimationPlayerCollection::HasCurrentAnimationsForProperties(
|
||||
size_t aPropertyCount) const
|
||||
{
|
||||
for (size_t playerIdx = mPlayers.Length(); playerIdx-- != 0; ) {
|
||||
const AnimationPlayer& player = *mPlayers[playerIdx];
|
||||
const Animation& player = *mPlayers[playerIdx];
|
||||
const KeyframeEffectReadonly* effect = player.GetEffect();
|
||||
if (effect &&
|
||||
effect->IsCurrent(player) &&
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include "nsDisplayList.h" // For nsDisplayItem::Type
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/StyleAnimationValue.h"
|
||||
#include "mozilla/dom/AnimationPlayer.h"
|
||||
#include "mozilla/dom/Animation.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/Nullable.h"
|
||||
#include "nsStyleStruct.h"
|
||||
@ -223,8 +223,7 @@ private:
|
||||
|
||||
} /* end css sub-namespace */
|
||||
|
||||
typedef InfallibleTArray<nsRefPtr<dom::AnimationPlayer> >
|
||||
AnimationPlayerPtrArray;
|
||||
typedef InfallibleTArray<nsRefPtr<dom::Animation>> AnimationPlayerPtrArray;
|
||||
|
||||
enum EnsureStyleRuleFlags {
|
||||
EnsureStyleRule_IsThrottled,
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::css;
|
||||
using mozilla::dom::AnimationPlayer;
|
||||
using mozilla::dom::Animation;
|
||||
using mozilla::dom::KeyframeEffectReadonly;
|
||||
using mozilla::CSSAnimationPlayer;
|
||||
|
||||
@ -32,21 +32,21 @@ mozilla::dom::Promise*
|
||||
CSSAnimationPlayer::GetReady(ErrorResult& aRv)
|
||||
{
|
||||
FlushStyle();
|
||||
return AnimationPlayer::GetReady(aRv);
|
||||
return Animation::GetReady(aRv);
|
||||
}
|
||||
|
||||
void
|
||||
CSSAnimationPlayer::Play(LimitBehavior aLimitBehavior)
|
||||
{
|
||||
mPauseShouldStick = false;
|
||||
AnimationPlayer::Play(aLimitBehavior);
|
||||
Animation::Play(aLimitBehavior);
|
||||
}
|
||||
|
||||
void
|
||||
CSSAnimationPlayer::Pause()
|
||||
{
|
||||
mPauseShouldStick = true;
|
||||
AnimationPlayer::Pause();
|
||||
Animation::Pause();
|
||||
}
|
||||
|
||||
mozilla::dom::AnimationPlayState
|
||||
@ -55,7 +55,7 @@ CSSAnimationPlayer::PlayStateFromJS() const
|
||||
// Flush style to ensure that any properties controlling animation state
|
||||
// (e.g. animation-play-state) are fully updated.
|
||||
FlushStyle();
|
||||
return AnimationPlayer::PlayStateFromJS();
|
||||
return Animation::PlayStateFromJS();
|
||||
}
|
||||
|
||||
void
|
||||
@ -64,7 +64,7 @@ CSSAnimationPlayer::PlayFromJS()
|
||||
// Note that flushing style below might trigger calls to
|
||||
// PlayFromStyle()/PauseFromStyle() on this object.
|
||||
FlushStyle();
|
||||
AnimationPlayer::PlayFromJS();
|
||||
Animation::PlayFromJS();
|
||||
}
|
||||
|
||||
void
|
||||
@ -72,7 +72,7 @@ CSSAnimationPlayer::PlayFromStyle()
|
||||
{
|
||||
mIsStylePaused = false;
|
||||
if (!mPauseShouldStick) {
|
||||
DoPlay(AnimationPlayer::LimitBehavior::Continue);
|
||||
DoPlay(Animation::LimitBehavior::Continue);
|
||||
}
|
||||
}
|
||||
|
||||
@ -327,7 +327,7 @@ nsAnimationManager::CheckAnimationRule(nsStyleContext* aStyleContext,
|
||||
if (!collection->mPlayers.IsEmpty()) {
|
||||
|
||||
for (size_t newIdx = newPlayers.Length(); newIdx-- != 0;) {
|
||||
AnimationPlayer* newPlayer = newPlayers[newIdx];
|
||||
Animation* newPlayer = newPlayers[newIdx];
|
||||
|
||||
// Find the matching animation with this name in the old list
|
||||
// of animations. We iterate through both lists in a backwards
|
||||
@ -507,7 +507,7 @@ nsAnimationManager::BuildAnimations(nsStyleContext* aStyleContext,
|
||||
// not generate animation events. This includes when the animation-name is
|
||||
// "none" which is represented by an empty name in the StyleAnimation.
|
||||
// Since such animations neither affect style nor dispatch events, we do
|
||||
// not generate a corresponding AnimationPlayer for them.
|
||||
// not generate a corresponding Animation for them.
|
||||
nsCSSKeyframesRule* rule =
|
||||
src.GetName().IsEmpty()
|
||||
? nullptr
|
||||
@ -753,7 +753,7 @@ nsAnimationManager::UpdateCascadeResults(
|
||||
|
||||
for (size_t playerIdx = aElementAnimations->mPlayers.Length();
|
||||
playerIdx-- != 0; ) {
|
||||
const AnimationPlayer* player = aElementAnimations->mPlayers[playerIdx];
|
||||
const Animation* player = aElementAnimations->mPlayers[playerIdx];
|
||||
const KeyframeEffectReadonly* effect = player->GetEffect();
|
||||
if (!effect) {
|
||||
continue;
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "mozilla/ContentEvents.h"
|
||||
#include "AnimationCommon.h"
|
||||
#include "nsCSSPseudoElements.h"
|
||||
#include "mozilla/dom/AnimationPlayer.h"
|
||||
#include "mozilla/dom/Animation.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/TimeStamp.h"
|
||||
|
||||
@ -52,11 +52,11 @@ struct AnimationEventInfo {
|
||||
|
||||
typedef InfallibleTArray<AnimationEventInfo> EventArray;
|
||||
|
||||
class CSSAnimationPlayer final : public dom::AnimationPlayer
|
||||
class CSSAnimationPlayer final : public dom::Animation
|
||||
{
|
||||
public:
|
||||
explicit CSSAnimationPlayer(dom::DocumentTimeline* aTimeline)
|
||||
: dom::AnimationPlayer(aTimeline)
|
||||
: dom::Animation(aTimeline)
|
||||
, mIsStylePaused(false)
|
||||
, mPauseShouldStick(false)
|
||||
, mPreviousPhaseOrIteration(PREVIOUS_PHASE_BEFORE)
|
||||
@ -125,7 +125,7 @@ protected:
|
||||
// 'running' A | A | C | C | A
|
||||
// 'paused' E | B | D | D | E
|
||||
//
|
||||
// The base class, AnimationPlayer already provides a boolean value,
|
||||
// The base class, Animation already provides a boolean value,
|
||||
// mIsPaused which gives us two states. To this we add a further two booleans
|
||||
// to represent the states as follows.
|
||||
//
|
||||
|
@ -33,11 +33,10 @@
|
||||
|
||||
using mozilla::TimeStamp;
|
||||
using mozilla::TimeDuration;
|
||||
using mozilla::dom::AnimationPlayer;
|
||||
using mozilla::dom::Animation;
|
||||
using mozilla::dom::KeyframeEffectReadonly;
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::layers;
|
||||
using namespace mozilla::css;
|
||||
|
||||
const nsString&
|
||||
@ -90,14 +89,14 @@ mozilla::dom::AnimationPlayState
|
||||
CSSTransitionPlayer::PlayStateFromJS() const
|
||||
{
|
||||
FlushStyle();
|
||||
return AnimationPlayer::PlayStateFromJS();
|
||||
return Animation::PlayStateFromJS();
|
||||
}
|
||||
|
||||
void
|
||||
CSSTransitionPlayer::PlayFromJS()
|
||||
{
|
||||
FlushStyle();
|
||||
AnimationPlayer::PlayFromJS();
|
||||
Animation::PlayFromJS();
|
||||
}
|
||||
|
||||
CommonAnimationManager*
|
||||
@ -320,7 +319,7 @@ nsTransitionManager::StyleContextChanged(dom::Element *aElement,
|
||||
StyleAnimationValue currentValue;
|
||||
do {
|
||||
--i;
|
||||
AnimationPlayer* player = players[i];
|
||||
Animation* player = players[i];
|
||||
dom::KeyframeEffectReadonly* effect = player->GetEffect();
|
||||
MOZ_ASSERT(effect && effect->Properties().Length() == 1,
|
||||
"Should have one animation property for a transition");
|
||||
@ -808,7 +807,7 @@ nsTransitionManager::FlushTransitions(FlushFlags aFlags)
|
||||
bool transitionStartedOrEnded = false;
|
||||
do {
|
||||
--i;
|
||||
AnimationPlayer* player = collection->mPlayers[i];
|
||||
Animation* player = collection->mPlayers[i];
|
||||
if (!player->GetEffect()->IsFinishedTransition()) {
|
||||
MOZ_ASSERT(player->GetEffect(),
|
||||
"Transitions should have an effect");
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/AnimationPlayer.h"
|
||||
#include "mozilla/dom/Animation.h"
|
||||
#include "mozilla/dom/KeyframeEffect.h"
|
||||
#include "AnimationCommon.h"
|
||||
#include "nsCSSPseudoElements.h"
|
||||
@ -75,11 +75,11 @@ struct ElementPropertyTransition : public dom::KeyframeEffectReadonly
|
||||
double CurrentValuePortion() const;
|
||||
};
|
||||
|
||||
class CSSTransitionPlayer final : public dom::AnimationPlayer
|
||||
class CSSTransitionPlayer final : public dom::Animation
|
||||
{
|
||||
public:
|
||||
explicit CSSTransitionPlayer(dom::DocumentTimeline* aTimeline)
|
||||
: dom::AnimationPlayer(aTimeline)
|
||||
: dom::Animation(aTimeline)
|
||||
{
|
||||
}
|
||||
|
||||
@ -91,7 +91,7 @@ public:
|
||||
|
||||
// A variant of Play() that avoids posting style updates since this method
|
||||
// is expected to be called whilst already updating style.
|
||||
void PlayFromStyle() { DoPlay(AnimationPlayer::LimitBehavior::Continue); }
|
||||
void PlayFromStyle() { DoPlay(Animation::LimitBehavior::Continue); }
|
||||
|
||||
protected:
|
||||
virtual ~CSSTransitionPlayer() { }
|
||||
|
Loading…
Reference in New Issue
Block a user