2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2014-08-10 11:06:46 +04:00
|
|
|
/* 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/. */
|
|
|
|
|
2015-04-15 02:48:21 +03:00
|
|
|
#ifndef mozilla_dom_KeyframeEffect_h
|
|
|
|
#define mozilla_dom_KeyframeEffect_h
|
2014-08-10 11:06:46 +04:00
|
|
|
|
|
|
|
#include "nsWrapperCache.h"
|
2016-12-07 12:47:23 +03:00
|
|
|
#include "mozilla/dom/BindingDeclarations.h"
|
2016-09-04 10:34:21 +03:00
|
|
|
#include "mozilla/dom/KeyframeEffectReadOnly.h"
|
|
|
|
#include "mozilla/AnimationTarget.h" // For (Non)OwningAnimationTarget
|
|
|
|
#include "mozilla/Maybe.h"
|
2014-08-10 11:06:46 +04:00
|
|
|
|
|
|
|
struct JSContext;
|
2016-09-04 10:34:21 +03:00
|
|
|
class JSObject;
|
2015-11-06 04:51:00 +03:00
|
|
|
class nsIDocument;
|
2014-08-10 11:06:46 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
2015-07-29 04:57:39 +03:00
|
|
|
|
2016-09-04 10:34:21 +03:00
|
|
|
class ErrorResult;
|
|
|
|
struct KeyframeEffectParams;
|
|
|
|
struct TimingParams;
|
2014-08-10 11:06:49 +04:00
|
|
|
|
2015-10-23 01:48:00 +03:00
|
|
|
namespace dom {
|
2016-09-04 10:34:21 +03:00
|
|
|
|
2016-02-05 21:01:00 +03:00
|
|
|
class ElementOrCSSPseudoElement;
|
2016-09-04 10:34:21 +03:00
|
|
|
class GlobalObject;
|
2016-03-12 16:14:10 +03:00
|
|
|
class UnrestrictedDoubleOrKeyframeAnimationOptions;
|
2015-11-19 21:48:00 +03:00
|
|
|
class UnrestrictedDoubleOrKeyframeEffectOptions;
|
2014-08-10 11:06:46 +04:00
|
|
|
|
2016-02-15 03:34:47 +03:00
|
|
|
class KeyframeEffect : public KeyframeEffectReadOnly
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
KeyframeEffect(nsIDocument* aDocument,
|
2016-04-28 18:22:44 +03:00
|
|
|
const Maybe<OwningAnimationTarget>& aTarget,
|
2016-05-05 10:41:03 +03:00
|
|
|
const TimingParams& aTiming,
|
|
|
|
const KeyframeEffectParams& aOptions);
|
2016-02-15 03:34:47 +03:00
|
|
|
|
|
|
|
JSObject* WrapObject(JSContext* aCx,
|
|
|
|
JS::Handle<JSObject*> aGivenProto) override;
|
2016-02-15 03:34:47 +03:00
|
|
|
|
|
|
|
static already_AddRefed<KeyframeEffect>
|
|
|
|
Constructor(const GlobalObject& aGlobal,
|
|
|
|
const Nullable<ElementOrCSSPseudoElement>& aTarget,
|
2016-05-13 03:40:52 +03:00
|
|
|
JS::Handle<JSObject*> aKeyframes,
|
2016-02-15 03:34:47 +03:00
|
|
|
const UnrestrictedDoubleOrKeyframeEffectOptions& aOptions,
|
2016-03-11 11:27:16 +03:00
|
|
|
ErrorResult& aRv);
|
2016-02-15 03:34:47 +03:00
|
|
|
|
2016-10-28 10:41:08 +03:00
|
|
|
static already_AddRefed<KeyframeEffect>
|
|
|
|
Constructor(const GlobalObject& aGlobal,
|
|
|
|
KeyframeEffectReadOnly& aSource,
|
|
|
|
ErrorResult& aRv);
|
|
|
|
|
2016-03-12 16:14:10 +03:00
|
|
|
// Variant of Constructor that accepts a KeyframeAnimationOptions object
|
|
|
|
// for use with for Animatable.animate.
|
2016-02-15 03:34:47 +03:00
|
|
|
// Not exposed to content.
|
|
|
|
static already_AddRefed<KeyframeEffect>
|
2016-03-11 11:27:16 +03:00
|
|
|
Constructor(const GlobalObject& aGlobal,
|
|
|
|
const Nullable<ElementOrCSSPseudoElement>& aTarget,
|
2016-05-13 03:40:52 +03:00
|
|
|
JS::Handle<JSObject*> aKeyframes,
|
2016-03-12 16:14:10 +03:00
|
|
|
const UnrestrictedDoubleOrKeyframeAnimationOptions& aOptions,
|
2016-03-11 11:27:16 +03:00
|
|
|
ErrorResult& aRv);
|
2016-02-27 00:39:30 +03:00
|
|
|
|
2016-02-27 00:39:49 +03:00
|
|
|
void NotifySpecifiedTimingUpdated();
|
|
|
|
|
2016-05-11 06:41:20 +03:00
|
|
|
// This method calls GetTargetStyleContext which is not safe to use when
|
2016-04-28 18:22:43 +03:00
|
|
|
// we are in the middle of updating style. If we need to use this when
|
|
|
|
// updating style, we should pass the nsStyleContext into this method and use
|
|
|
|
// that to update the properties rather than calling
|
2017-04-05 08:39:23 +03:00
|
|
|
// GetStyleContext.
|
2016-04-28 18:22:43 +03:00
|
|
|
void SetTarget(const Nullable<ElementOrCSSPseudoElement>& aTarget);
|
2016-08-31 11:58:57 +03:00
|
|
|
|
2016-12-07 12:47:23 +03:00
|
|
|
IterationCompositeOperation IterationComposite(CallerType aCallerType)
|
|
|
|
{
|
|
|
|
return KeyframeEffectReadOnly::IterationComposite();
|
|
|
|
}
|
2016-09-13 05:48:44 +03:00
|
|
|
void SetIterationComposite(
|
2016-12-07 12:47:23 +03:00
|
|
|
const IterationCompositeOperation& aIterationComposite,
|
|
|
|
CallerType aCallerType);
|
2016-12-14 02:51:44 +03:00
|
|
|
void SetComposite(const CompositeOperation& aComposite);
|
2016-02-15 03:34:47 +03:00
|
|
|
};
|
|
|
|
|
2014-08-10 11:06:46 +04:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2015-04-15 02:48:21 +03:00
|
|
|
#endif // mozilla_dom_KeyframeEffect_h
|