Bug 1415780 - Rename DelayedEventsDispatcher to AnimationEventDispatcher. r?birtles
We plan to use this class to dispatch web animation API events as well
(
bug 1354501).
MozReview-Commit-ID: 7DMmc0aJzJ5
--- a/layout/style/AnimationCommon.h
+++ b/layout/style/AnimationCommon.h
@@ -22,17 +22,17 @@
#include "nsCSSPseudoElements.h"
#include "nsCycleCollectionParticipant.h"
class nsIFrame;
class nsPresContext;
namespace mozilla {
enum class CSSPseudoElementType : uint8_t;
-template <class EventInfo> class DelayedEventDispatcher;
+template <class EventInfo> class AnimationEventDispatcher;
namespace dom {
class Element;
}
template <class AnimationType, class AnimationEventType>
class CommonAnimationManager {
public:
@@ -103,17 +103,17 @@ protected:
mElementCollections.getFirst()) {
head->Destroy(); // Note: this removes 'head' from mElementCollections.
}
}
LinkedList<AnimationCollection<AnimationType>> mElementCollections;
nsPresContext *mPresContext; // weak (non-null from ctor to Disconnect)
- mozilla::DelayedEventDispatcher<AnimationEventType> mEventDispatcher;
+ mozilla::AnimationEventDispatcher<AnimationEventType> mEventDispatcher;
};
/**
* Utility class for referencing the element that created a CSS animation or
* transition. It is non-owning (i.e. it uses a raw pointer) since it is only
* expected to be set by the owned animation while it actually being managed
* by the owning element.
*
@@ -175,20 +175,20 @@ public:
return nsContentUtils::GetContextForContent(mTarget.mElement);
}
private:
NonOwningAnimationTarget mTarget;
};
template <class EventInfo>
-class DelayedEventDispatcher
+class AnimationEventDispatcher
{
public:
- DelayedEventDispatcher() : mIsSorted(true) { }
+ AnimationEventDispatcher() : mIsSorted(true) { }
void QueueEvents(nsTArray<EventInfo>&& aEvents)
{
mPendingEvents.AppendElements(Forward<nsTArray<EventInfo>>(aEvents));
mIsSorted = false;
}
// This is exposed as a separate method so that when we are dispatching
@@ -275,25 +275,25 @@ protected:
typedef nsTArray<EventInfo> EventArray;
EventArray mPendingEvents;
bool mIsSorted;
};
template <class EventInfo>
inline void
-ImplCycleCollectionUnlink(DelayedEventDispatcher<EventInfo>& aField)
+ImplCycleCollectionUnlink(AnimationEventDispatcher<EventInfo>& aField)
{
aField.Unlink();
}
template <class EventInfo>
inline void
ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback,
- DelayedEventDispatcher<EventInfo>& aField,
+ AnimationEventDispatcher<EventInfo>& aField,
const char* aName,
uint32_t aFlags = 0)
{
aField.Traverse(&aCallback, aName);
}
// Return the TransitionPhase or AnimationPhase to use when the animation
// doesn't have a target effect.