mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
feea3d3911
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.
52 lines
1.4 KiB
C++
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
|