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/. */
|
|
|
|
|
|
|
|
#include "mozilla/dom/AnimationEffectTimingReadOnly.h"
|
2016-01-29 04:37:52 +03:00
|
|
|
|
2016-02-05 21:01:00 +03:00
|
|
|
#include "mozilla/AnimationUtils.h"
|
2016-01-29 04:37:52 +03:00
|
|
|
#include "mozilla/dom/AnimatableBinding.h"
|
2016-01-13 20:37:00 +03:00
|
|
|
#include "mozilla/dom/AnimationEffectTimingReadOnlyBinding.h"
|
2016-02-05 21:11:00 +03:00
|
|
|
#include "mozilla/dom/CSSPseudoElement.h"
|
2016-01-29 04:37:52 +03:00
|
|
|
#include "mozilla/dom/KeyframeEffectBinding.h"
|
2016-01-13 20:37:00 +03:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2016-07-13 05:32:05 +03:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(AnimationEffectTimingReadOnly, mDocument)
|
2016-01-13 20:37:00 +03:00
|
|
|
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(AnimationEffectTimingReadOnly, AddRef)
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(AnimationEffectTimingReadOnly, Release)
|
|
|
|
|
|
|
|
JSObject*
|
|
|
|
AnimationEffectTimingReadOnly::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
|
|
|
{
|
|
|
|
return AnimationEffectTimingReadOnlyBinding::Wrap(aCx, this, aGivenProto);
|
|
|
|
}
|
|
|
|
|
2016-03-09 08:14:20 +03:00
|
|
|
void
|
|
|
|
AnimationEffectTimingReadOnly::GetDuration(
|
|
|
|
OwningUnrestrictedDoubleOrString& aRetVal) const
|
|
|
|
{
|
|
|
|
if (mTiming.mDuration) {
|
|
|
|
aRetVal.SetAsUnrestrictedDouble() = mTiming.mDuration->ToMilliseconds();
|
|
|
|
} else {
|
|
|
|
aRetVal.SetAsString().AssignLiteral("auto");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-01-29 16:45:00 +03:00
|
|
|
void
|
|
|
|
AnimationEffectTimingReadOnly::GetEasing(nsString& aRetVal) const
|
|
|
|
{
|
2016-03-26 04:52:08 +03:00
|
|
|
if (mTiming.mFunction) {
|
2016-01-29 16:45:00 +03:00
|
|
|
mTiming.mFunction->AppendToString(aRetVal);
|
|
|
|
} else {
|
|
|
|
aRetVal.AssignLiteral("linear");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-01-13 20:37:00 +03:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|