mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Bug 1150810 part 10 - Add AnimationTimeline::GetAnimations; r=jwatt; r=smaug
This patch also removes the (commented-out) play() method from the AnimationTimeline.webidl since it has been removed from the spec. --HG-- extra : commitid : 20j8RFhPyP9 extra : rebase_source : 9eb5376f3ad9f4a4a0a214bdbe5593f682316d5b
This commit is contained in:
parent
e725d9bdb4
commit
6434e79a4b
@ -19,6 +19,26 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(AnimationTimeline)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
static PLDHashOperator
|
||||
AppendAnimationToSequence(nsRefPtrHashKey<dom::Animation>* aKey,
|
||||
void* aSequence)
|
||||
{
|
||||
Animation* animation = aKey->GetKey();
|
||||
AnimationTimeline::AnimationSequence* sequence =
|
||||
static_cast<AnimationTimeline::AnimationSequence*>(aSequence);
|
||||
sequence->AppendElement(animation);
|
||||
|
||||
return PL_DHASH_NEXT;
|
||||
}
|
||||
|
||||
void
|
||||
AnimationTimeline::GetAnimations(AnimationSequence& aAnimations)
|
||||
{
|
||||
// FIXME: Flush the document here (fixed in a subsequent patch)
|
||||
|
||||
mAnimations.EnumerateEntries(AppendAnimationToSequence, &aAnimations);
|
||||
}
|
||||
|
||||
void
|
||||
AnimationTimeline::AddAnimation(Animation& aAnimation)
|
||||
{
|
||||
|
@ -40,8 +40,11 @@ public:
|
||||
|
||||
nsIGlobalObject* GetParentObject() const { return mWindow; }
|
||||
|
||||
typedef nsTArray<nsRefPtr<Animation>> AnimationSequence;
|
||||
|
||||
// AnimationTimeline methods
|
||||
virtual Nullable<TimeDuration> GetCurrentTime() const = 0;
|
||||
void GetAnimations(AnimationSequence& aAnimations);
|
||||
|
||||
// Wrapper functions for AnimationTimeline DOM methods when called from
|
||||
// script.
|
||||
|
@ -14,7 +14,5 @@
|
||||
interface AnimationTimeline {
|
||||
[BinaryName="currentTimeAsDouble"]
|
||||
readonly attribute double? currentTime;
|
||||
// Not yet implemented:
|
||||
// Animation play (optional TimedItem? source = null);
|
||||
// sequence<Animation> getAnimations ();
|
||||
sequence<Animation> getAnimations ();
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user