mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1073336 part 10 - Add AnimationPlayer::GetAnimationManager(); r=dbaron
This patch introduces an abstract method to AnimationPlayer to fetch the manager object associated with the player. This method is implemented separate by CSSAnimationPlayer and CSSTransitionPlayer to return the nsAnimationManager or nsTransitionManager accordingly.
This commit is contained in:
parent
aa668ac8e6
commit
3b5c4f0d9d
@ -28,6 +28,7 @@ class nsPresContext;
|
||||
namespace mozilla {
|
||||
namespace css {
|
||||
class AnimValuesStyleRule;
|
||||
class CommonAnimationManager;
|
||||
} // namespace css
|
||||
|
||||
class CSSAnimationPlayer;
|
||||
@ -130,6 +131,7 @@ protected:
|
||||
|
||||
nsIDocument* GetRenderedDocument() const;
|
||||
nsPresContext* GetPresContext() const;
|
||||
virtual css::CommonAnimationManager* GetAnimationManager() const = 0;
|
||||
|
||||
nsRefPtr<AnimationTimeline> mTimeline;
|
||||
nsRefPtr<Animation> mSource;
|
||||
|
@ -152,6 +152,17 @@ CSSAnimationPlayer::QueueEvents(EventArray& aEventsToDispatch)
|
||||
}
|
||||
}
|
||||
|
||||
CommonAnimationManager*
|
||||
CSSAnimationPlayer::GetAnimationManager() const
|
||||
{
|
||||
nsPresContext* context = GetPresContext();
|
||||
if (!context) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return context->AnimationManager();
|
||||
}
|
||||
|
||||
/* static */ nsString
|
||||
CSSAnimationPlayer::PseudoTypeAsString(nsCSSPseudoElements::Type aPseudoType)
|
||||
{
|
||||
|
@ -78,6 +78,7 @@ public:
|
||||
|
||||
protected:
|
||||
virtual ~CSSAnimationPlayer() { }
|
||||
virtual css::CommonAnimationManager* GetAnimationManager() const MOZ_OVERRIDE;
|
||||
|
||||
static nsString PseudoTypeAsString(nsCSSPseudoElements::Type aPseudoType);
|
||||
|
||||
|
@ -88,6 +88,17 @@ CSSTransitionPlayer::PlayFromJS()
|
||||
AnimationPlayer::PlayFromJS();
|
||||
}
|
||||
|
||||
CommonAnimationManager*
|
||||
CSSTransitionPlayer::GetAnimationManager() const
|
||||
{
|
||||
nsPresContext* context = GetPresContext();
|
||||
if (!context) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return context->TransitionManager();
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* nsTransitionManager *
|
||||
*****************************************************************************/
|
||||
|
@ -81,6 +81,8 @@ public:
|
||||
|
||||
protected:
|
||||
virtual ~CSSTransitionPlayer() { }
|
||||
|
||||
virtual css::CommonAnimationManager* GetAnimationManager() const MOZ_OVERRIDE;
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
Loading…
Reference in New Issue
Block a user