Bug 1150810 part 2 - Replace references to DocumentTimeline with AnimationTimeline; r=jwatt

This is needed not only for supporting other kinds of timelines, but also for
when we come to implement SetTimeline(AnimationTimeline* aTimeline).
This commit is contained in:
Brian Birtles 2015-04-28 11:29:13 +09:00
parent 3b62eec6f6
commit 128bbb53ef
7 changed files with 14 additions and 12 deletions

View File

@ -174,7 +174,7 @@ Animation::PlayState() const
}
static inline already_AddRefed<Promise>
CreatePromise(DocumentTimeline* aTimeline, ErrorResult& aRv)
CreatePromise(AnimationTimeline* aTimeline, ErrorResult& aRv)
{
nsIGlobalObject* global = aTimeline->GetParentObject();
if (global) {

View File

@ -12,7 +12,7 @@
#include "mozilla/Attributes.h"
#include "mozilla/TimeStamp.h" // for TimeStamp, TimeDuration
#include "mozilla/dom/AnimationBinding.h" // for AnimationPlayState
#include "mozilla/dom/DocumentTimeline.h" // for DocumentTimeline
#include "mozilla/dom/AnimationTimeline.h" // for AnimationTimeline
#include "mozilla/dom/KeyframeEffect.h" // for KeyframeEffectReadOnly
#include "mozilla/dom/Promise.h" // for Promise
#include "nsCSSProperty.h" // for nsCSSProperty
@ -53,7 +53,7 @@ protected:
virtual ~Animation() {}
public:
explicit Animation(DocumentTimeline* aTimeline)
explicit Animation(AnimationTimeline* aTimeline)
: mTimeline(aTimeline)
, mPlaybackRate(1.0)
, mPendingState(PendingState::NotPending)
@ -68,7 +68,7 @@ public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Animation)
DocumentTimeline* GetParentObject() const { return mTimeline; }
AnimationTimeline* GetParentObject() const { return mTimeline; }
virtual JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) override;
@ -92,7 +92,7 @@ public:
KeyframeEffectReadOnly* GetEffect() const { return mEffect; }
void SetEffect(KeyframeEffectReadOnly* aEffect);
DocumentTimeline* Timeline() const { return mTimeline; }
AnimationTimeline* Timeline() const { return mTimeline; }
Nullable<TimeDuration> GetStartTime() const { return mStartTime; }
void SetStartTime(const Nullable<TimeDuration>& aNewStartTime);
Nullable<TimeDuration> GetCurrentTime() const;
@ -339,7 +339,7 @@ protected:
virtual css::CommonAnimationManager* GetAnimationManager() const = 0;
AnimationCollection* GetCollection() const;
nsRefPtr<DocumentTimeline> mTimeline;
nsRefPtr<AnimationTimeline> mTimeline;
nsRefPtr<KeyframeEffectReadOnly> mEffect;
// The beginning of the delay period.
Nullable<TimeDuration> mStartTime; // Timeline timescale

View File

@ -6,7 +6,7 @@
#include "PendingAnimationTracker.h"
#include "mozilla/dom/DocumentTimeline.h"
#include "mozilla/dom/AnimationTimeline.h"
#include "nsIFrame.h"
#include "nsIPresShell.h"
@ -53,7 +53,7 @@ TriggerAnimationAtTime(nsRefPtrHashKey<dom::Animation>* aKey,
void* aReadyTime)
{
dom::Animation* animation = aKey->GetKey();
dom::DocumentTimeline* timeline = animation->Timeline();
dom::AnimationTimeline* timeline = animation->Timeline();
// When the timeline's refresh driver is under test control, its values
// have no correspondance to wallclock times so we shouldn't try to convert

View File

@ -10,6 +10,7 @@
#include "mozilla/EventDispatcher.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/StyleAnimationValue.h"
#include "mozilla/dom/DocumentTimeline.h"
#include "mozilla/dom/KeyframeEffect.h"
#include "nsPresContext.h"
@ -569,7 +570,7 @@ ResolvedStyleCache::Get(nsPresContext *aPresContext,
void
nsAnimationManager::BuildAnimations(nsStyleContext* aStyleContext,
dom::Element* aTarget,
dom::DocumentTimeline* aTimeline,
dom::AnimationTimeline* aTimeline,
AnimationPtrArray& aAnimations)
{
MOZ_ASSERT(aAnimations.IsEmpty(), "expect empty array");

View File

@ -56,7 +56,7 @@ namespace dom {
class CSSAnimation final : public Animation
{
public:
explicit CSSAnimation(dom::DocumentTimeline* aTimeline,
explicit CSSAnimation(dom::AnimationTimeline* aTimeline,
const nsSubstring& aAnimationName)
: dom::Animation(aTimeline)
, mAnimationName(aAnimationName)
@ -309,7 +309,7 @@ protected:
private:
void BuildAnimations(nsStyleContext* aStyleContext,
mozilla::dom::Element* aTarget,
mozilla::dom::DocumentTimeline* aTimeline,
mozilla::dom::AnimationTimeline* aTimeline,
mozilla::AnimationPtrArray& aAnimations);
bool BuildSegment(InfallibleTArray<mozilla::AnimationPropertySegment>&
aSegments,

View File

@ -22,6 +22,7 @@
#include "mozilla/EventDispatcher.h"
#include "mozilla/ContentEvents.h"
#include "mozilla/StyleAnimationValue.h"
#include "mozilla/dom/DocumentTimeline.h"
#include "mozilla/dom/Element.h"
#include "nsIFrame.h"
#include "Layers.h"

View File

@ -79,7 +79,7 @@ namespace dom {
class CSSTransition final : public Animation
{
public:
explicit CSSTransition(dom::DocumentTimeline* aTimeline)
explicit CSSTransition(dom::AnimationTimeline* aTimeline)
: dom::Animation(aTimeline)
{
}