2016-01-13 20:37:00 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim:set ts=2 sw=2 sts=2 et cindent: */
|
|
|
|
/* 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_AnimationEffectTimingReadOnly_h
|
|
|
|
#define mozilla_dom_AnimationEffectTimingReadOnly_h
|
|
|
|
|
|
|
|
#include "js/TypeDecls.h"
|
|
|
|
#include "mozilla/Attributes.h"
|
|
|
|
#include "mozilla/ErrorResult.h"
|
2016-03-07 08:11:11 +03:00
|
|
|
#include "mozilla/TimingParams.h"
|
2016-01-13 20:37:00 +03:00
|
|
|
#include "mozilla/dom/BindingDeclarations.h"
|
|
|
|
#include "mozilla/dom/UnionTypes.h"
|
|
|
|
#include "nsCycleCollectionParticipant.h"
|
|
|
|
#include "nsWrapperCache.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
class AnimationEffectTimingReadOnly : public nsWrapperCache
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
AnimationEffectTimingReadOnly() = default;
|
2016-07-13 05:32:05 +03:00
|
|
|
AnimationEffectTimingReadOnly(nsIDocument* aDocument,
|
2016-04-10 08:51:32 +03:00
|
|
|
const TimingParams& aTiming)
|
2016-07-13 05:32:05 +03:00
|
|
|
: mDocument(aDocument)
|
2016-04-10 08:51:32 +03:00
|
|
|
, mTiming(aTiming) { }
|
2016-01-13 20:37:00 +03:00
|
|
|
|
|
|
|
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(AnimationEffectTimingReadOnly)
|
|
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(AnimationEffectTimingReadOnly)
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual ~AnimationEffectTimingReadOnly() = default;
|
|
|
|
|
|
|
|
public:
|
2016-07-13 05:32:05 +03:00
|
|
|
nsISupports* GetParentObject() const { return mDocument; }
|
2016-01-13 20:37:00 +03:00
|
|
|
JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
|
|
|
|
|
|
|
|
double Delay() const { return mTiming.mDelay.ToMilliseconds(); }
|
2016-03-08 04:31:10 +03:00
|
|
|
double EndDelay() const { return mTiming.mEndDelay.ToMilliseconds(); }
|
2016-01-13 20:37:00 +03:00
|
|
|
FillMode Fill() const { return mTiming.mFill; }
|
2016-03-02 10:23:34 +03:00
|
|
|
double IterationStart() const { return mTiming.mIterationStart; }
|
2016-01-13 20:37:00 +03:00
|
|
|
double Iterations() const { return mTiming.mIterations; }
|
2016-03-09 08:14:20 +03:00
|
|
|
void GetDuration(OwningUnrestrictedDoubleOrString& aRetVal) const;
|
2016-01-13 20:37:00 +03:00
|
|
|
PlaybackDirection Direction() const { return mTiming.mDirection; }
|
2016-01-29 16:45:00 +03:00
|
|
|
void GetEasing(nsString& aRetVal) const;
|
2016-01-13 20:37:00 +03:00
|
|
|
|
2016-01-13 20:41:00 +03:00
|
|
|
const TimingParams& AsTimingParams() const { return mTiming; }
|
|
|
|
void SetTimingParams(const TimingParams& aTiming) { mTiming = aTiming; }
|
2016-01-13 20:37:00 +03:00
|
|
|
|
2016-02-27 00:39:30 +03:00
|
|
|
virtual void Unlink() { }
|
|
|
|
|
2016-01-13 20:37:00 +03:00
|
|
|
protected:
|
2016-07-13 05:32:05 +03:00
|
|
|
RefPtr<nsIDocument> mDocument;
|
2016-01-13 20:41:00 +03:00
|
|
|
TimingParams mTiming;
|
2016-01-13 20:37:00 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_AnimationEffectTimingReadOnly_h
|