gecko/dom/animation/Animation.h
Brian Birtles feea3d3911 Bug 1040543 part 5 - Pass down time from AnimationPlayer to Animation; r=bz
This patch makes AnimationPlayers pass their current time down to the Animation
they are playing.

Since all Animations need from their players is their time, this avoids adding
a pointer back to their AnimationPlayer.
2014-08-10 17:06:48 +10:00

52 lines
1.4 KiB
C++

/* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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_Animation_h
#define mozilla_dom_Animation_h
#include "nsAutoPtr.h"
#include "nsCycleCollectionParticipant.h"
#include "nsIDocument.h"
#include "nsWrapperCache.h"
#include "mozilla/Attributes.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/dom/Nullable.h"
struct JSContext;
namespace mozilla {
namespace dom {
class Animation MOZ_FINAL : public nsWrapperCache
{
public:
explicit Animation(nsIDocument* aDocument)
: mDocument(aDocument)
{
SetIsDOMBinding();
}
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(Animation)
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(Animation)
nsIDocument* GetParentObject() const { return mDocument; }
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
void SetParentTime(Nullable<TimeDuration> aParentTime);
protected:
virtual ~Animation() { }
// We use a document for a parent object since the other likely candidate,
// the target element, can be empty.
nsRefPtr<nsIDocument> mDocument;
Nullable<TimeDuration> mParentTime;
};
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_Animation_h