mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 08:12:05 +00:00
Bug 1188251 part 7 - Move WillRefresh to CommonAnimationManager; r=dholbert
nsTransitionManager::WillRefresh and nsAnimationManager::WillRefresh are now identical and all methods they call exist on CommonAnimationManager so we can unify them there.
This commit is contained in:
parent
d65e0109bc
commit
d263e17945
@ -466,6 +466,24 @@ CommonAnimationManager::LayerAnimationRecordFor(nsCSSProperty aProperty)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* virtual */ void
|
||||
CommonAnimationManager::WillRefresh(TimeStamp aTime)
|
||||
{
|
||||
MOZ_ASSERT(mPresContext,
|
||||
"refresh driver should not notify additional observers "
|
||||
"after pres context has been destroyed");
|
||||
if (!mPresContext->GetPresShell()) {
|
||||
// Someone might be keeping mPresContext alive past the point
|
||||
// where it has been torn down; don't bother doing anything in
|
||||
// this case. But do get rid of all our animations so we stop
|
||||
// triggering refreshes.
|
||||
RemoveAllElementCollections();
|
||||
return;
|
||||
}
|
||||
|
||||
FlushAnimations(Can_Throttle);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
/* static */ void
|
||||
CommonAnimationManager::Initialize()
|
||||
|
@ -62,6 +62,9 @@ public:
|
||||
virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf)
|
||||
const MOZ_MUST_OVERRIDE override;
|
||||
|
||||
// nsARefreshObserver
|
||||
void WillRefresh(TimeStamp aTime) override;
|
||||
|
||||
#ifdef DEBUG
|
||||
static void Initialize();
|
||||
#endif
|
||||
|
@ -939,21 +939,3 @@ nsAnimationManager::UpdateCascadeResults(
|
||||
aElementAnimations->mStyleRuleRefreshTime = TimeStamp();
|
||||
}
|
||||
}
|
||||
|
||||
/* virtual */ void
|
||||
nsAnimationManager::WillRefresh(mozilla::TimeStamp aTime)
|
||||
{
|
||||
MOZ_ASSERT(mPresContext,
|
||||
"refresh driver should not notify additional observers "
|
||||
"after pres context has been destroyed");
|
||||
if (!mPresContext->GetPresShell()) {
|
||||
// Someone might be keeping mPresContext alive past the point
|
||||
// where it has been torn down; don't bother doing anything in
|
||||
// this case. But do get rid of all our transitions so we stop
|
||||
// triggering refreshes.
|
||||
RemoveAllElementCollections();
|
||||
return;
|
||||
}
|
||||
|
||||
FlushAnimations(Can_Throttle);
|
||||
}
|
||||
|
@ -255,9 +255,6 @@ public:
|
||||
virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
|
||||
const MOZ_MUST_OVERRIDE override;
|
||||
|
||||
// nsARefreshObserver
|
||||
virtual void WillRefresh(mozilla::TimeStamp aTime) override;
|
||||
|
||||
/**
|
||||
* Return the style rule that RulesMatching should add for
|
||||
* aStyleContext. This might be different from what RulesMatching
|
||||
|
@ -887,21 +887,3 @@ nsTransitionManager::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
|
||||
}
|
||||
|
||||
/* virtual */ void
|
||||
nsTransitionManager::WillRefresh(mozilla::TimeStamp aTime)
|
||||
{
|
||||
MOZ_ASSERT(mPresContext,
|
||||
"refresh driver should not notify additional observers "
|
||||
"after pres context has been destroyed");
|
||||
if (!mPresContext->GetPresShell()) {
|
||||
// Someone might be keeping mPresContext alive past the point
|
||||
// where it has been torn down; don't bother doing anything in
|
||||
// this case. But do get rid of all our transitions so we stop
|
||||
// triggering refreshes.
|
||||
RemoveAllElementCollections();
|
||||
return;
|
||||
}
|
||||
|
||||
FlushAnimations(Can_Throttle);
|
||||
}
|
||||
|
@ -274,9 +274,6 @@ public:
|
||||
virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
MOZ_MUST_OVERRIDE override;
|
||||
|
||||
// nsARefreshObserver
|
||||
virtual void WillRefresh(mozilla::TimeStamp aTime) override;
|
||||
|
||||
void QueueEvent(mozilla::TransitionEventInfo&& aEventInfo)
|
||||
{
|
||||
mEventDispatcher.QueueEvent(
|
||||
|
Loading…
Reference in New Issue
Block a user