mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1178186 part 1 - Add CSSAnimation and CSSTransition interfaces; r=smaug
This commit is contained in:
parent
e701b816c3
commit
a02c9643ee
@ -40,11 +40,11 @@ class AnimValuesStyleRule;
|
||||
class CommonAnimationManager;
|
||||
} // namespace css
|
||||
|
||||
namespace dom {
|
||||
|
||||
class CSSAnimation;
|
||||
class CSSTransition;
|
||||
|
||||
namespace dom {
|
||||
|
||||
class Animation
|
||||
: public nsISupports
|
||||
, public nsWrapperCache
|
||||
|
@ -298,6 +298,8 @@ var interfaceNamesInGlobalScope =
|
||||
"CSS",
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
"CSS2Properties",
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
{name: "CSSAnimation", release: false},
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
"CSSConditionRule",
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
@ -334,6 +336,8 @@ var interfaceNamesInGlobalScope =
|
||||
"CSSStyleSheet",
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
"CSSSupportsRule",
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
{name: "CSSTransition", release: false},
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
"CSSValue",
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
|
16
dom/webidl/CSSAnimation.webidl
Normal file
16
dom/webidl/CSSAnimation.webidl
Normal file
@ -0,0 +1,16 @@
|
||||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* 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/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* http://dev.w3.org/csswg/css-animations-2/#the-CSSAnimation-interface
|
||||
*
|
||||
* Copyright © 2015 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
|
||||
* liability, trademark and document use rules apply.
|
||||
*/
|
||||
|
||||
[Func="nsDocument::IsWebAnimationsEnabled",
|
||||
HeaderFile="nsAnimationManager.h"]
|
||||
interface CSSAnimation : Animation {
|
||||
};
|
16
dom/webidl/CSSTransition.webidl
Normal file
16
dom/webidl/CSSTransition.webidl
Normal file
@ -0,0 +1,16 @@
|
||||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* 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/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* http://dev.w3.org/csswg/css-transitions-2/#the-CSSTransition-interface
|
||||
*
|
||||
* Copyright © 2015 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
|
||||
* liability, trademark and document use rules apply.
|
||||
*/
|
||||
|
||||
[Func="nsDocument::IsWebAnimationsEnabled",
|
||||
HeaderFile="nsTransitionManager.h"]
|
||||
interface CSSTransition : Animation {
|
||||
};
|
@ -91,11 +91,13 @@ WEBIDL_FILES = [
|
||||
'CSPDictionaries.webidl',
|
||||
'CSPReport.webidl',
|
||||
'CSS.webidl',
|
||||
'CSSAnimation.webidl',
|
||||
'CSSLexer.webidl',
|
||||
'CSSPrimitiveValue.webidl',
|
||||
'CSSRuleList.webidl',
|
||||
'CSSStyleDeclaration.webidl',
|
||||
'CSSStyleSheet.webidl',
|
||||
'CSSTransition.webidl',
|
||||
'CSSValue.webidl',
|
||||
'CSSValueList.webidl',
|
||||
'DataContainerEvent.webidl',
|
||||
|
@ -5,6 +5,7 @@
|
||||
|
||||
#include "nsAnimationManager.h"
|
||||
#include "nsTransitionManager.h"
|
||||
#include "mozilla/dom/CSSAnimationBinding.h"
|
||||
|
||||
#include "mozilla/EventDispatcher.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
@ -27,7 +28,13 @@ using namespace mozilla::css;
|
||||
using mozilla::dom::Animation;
|
||||
using mozilla::dom::AnimationPlayState;
|
||||
using mozilla::dom::KeyframeEffectReadOnly;
|
||||
using mozilla::CSSAnimation;
|
||||
using mozilla::dom::CSSAnimation;
|
||||
|
||||
JSObject*
|
||||
CSSAnimation::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
||||
{
|
||||
return dom::CSSAnimationBinding::Wrap(aCx, this, aGivenProto);
|
||||
}
|
||||
|
||||
mozilla::dom::Promise*
|
||||
CSSAnimation::GetReady(ErrorResult& aRv)
|
||||
|
@ -51,24 +51,29 @@ struct AnimationEventInfo {
|
||||
|
||||
typedef InfallibleTArray<AnimationEventInfo> EventArray;
|
||||
|
||||
class CSSAnimation final : public dom::Animation
|
||||
namespace dom {
|
||||
|
||||
class CSSAnimation final : public Animation
|
||||
{
|
||||
public:
|
||||
explicit CSSAnimation(dom::DocumentTimeline* aTimeline)
|
||||
: dom::Animation(aTimeline)
|
||||
explicit CSSAnimation(DocumentTimeline* aTimeline)
|
||||
: Animation(aTimeline)
|
||||
, mIsStylePaused(false)
|
||||
, mPauseShouldStick(false)
|
||||
, mPreviousPhaseOrIteration(PREVIOUS_PHASE_BEFORE)
|
||||
{
|
||||
}
|
||||
|
||||
JSObject* WrapObject(JSContext* aCx,
|
||||
JS::Handle<JSObject*> aGivenProto) override;
|
||||
|
||||
virtual CSSAnimation* AsCSSAnimation() override { return this; }
|
||||
|
||||
virtual dom::Promise* GetReady(ErrorResult& aRv) override;
|
||||
virtual Promise* GetReady(ErrorResult& aRv) override;
|
||||
virtual void Play(ErrorResult& aRv, LimitBehavior aLimitBehavior) override;
|
||||
virtual void Pause(ErrorResult& aRv) override;
|
||||
|
||||
virtual dom::AnimationPlayState PlayStateFromJS() const override;
|
||||
virtual AnimationPlayState PlayStateFromJS() const override;
|
||||
virtual void PlayFromJS(ErrorResult& aRv) override;
|
||||
|
||||
void PlayFromStyle();
|
||||
@ -152,6 +157,7 @@ protected:
|
||||
uint64_t mPreviousPhaseOrIteration;
|
||||
};
|
||||
|
||||
} /* namespace dom */
|
||||
} /* namespace mozilla */
|
||||
|
||||
class nsAnimationManager final
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
#include "nsTransitionManager.h"
|
||||
#include "nsAnimationManager.h"
|
||||
#include "mozilla/dom/CSSTransitionBinding.h"
|
||||
|
||||
#include "nsIContent.h"
|
||||
#include "nsStyleContext.h"
|
||||
#include "nsCSSProps.h"
|
||||
@ -85,7 +87,13 @@ ElementPropertyTransition::CurrentValuePortion() const
|
||||
* CSSTransition *
|
||||
*****************************************************************************/
|
||||
|
||||
mozilla::dom::AnimationPlayState
|
||||
JSObject*
|
||||
CSSTransition::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
||||
{
|
||||
return dom::CSSTransitionBinding::Wrap(aCx, this, aGivenProto);
|
||||
}
|
||||
|
||||
AnimationPlayState
|
||||
CSSTransition::PlayStateFromJS() const
|
||||
{
|
||||
FlushStyle();
|
||||
|
@ -74,17 +74,22 @@ struct ElementPropertyTransition : public dom::KeyframeEffectReadOnly
|
||||
double CurrentValuePortion() const;
|
||||
};
|
||||
|
||||
class CSSTransition final : public dom::Animation
|
||||
namespace dom {
|
||||
|
||||
class CSSTransition final : public Animation
|
||||
{
|
||||
public:
|
||||
explicit CSSTransition(dom::DocumentTimeline* aTimeline)
|
||||
: dom::Animation(aTimeline)
|
||||
explicit CSSTransition(DocumentTimeline* aTimeline)
|
||||
: Animation(aTimeline)
|
||||
{
|
||||
}
|
||||
|
||||
JSObject* WrapObject(JSContext* aCx,
|
||||
JS::Handle<JSObject*> aGivenProto) override;
|
||||
|
||||
virtual CSSTransition* AsCSSTransition() override { return this; }
|
||||
|
||||
virtual dom::AnimationPlayState PlayStateFromJS() const override;
|
||||
virtual AnimationPlayState PlayStateFromJS() const override;
|
||||
virtual void PlayFromJS(ErrorResult& aRv) override;
|
||||
|
||||
// A variant of Play() that avoids posting style updates since this method
|
||||
@ -103,6 +108,7 @@ protected:
|
||||
virtual css::CommonAnimationManager* GetAnimationManager() const override;
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
class nsTransitionManager final
|
||||
|
Loading…
Reference in New Issue
Block a user