mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1025709 part 5 - Replace aIsThrottled bool value with an enum; r=heycam
This commit is contained in:
parent
ae594f7975
commit
af843d9fd9
@ -243,7 +243,8 @@ CommonAnimationManager::UpdateThrottledStyle(dom::Element* aElement,
|
||||
"Rule has level eTransitionSheet without transition on manager");
|
||||
|
||||
et->EnsureStyleRuleFor(
|
||||
mPresContext->RefreshDriver()->MostRecentRefresh(), false);
|
||||
mPresContext->RefreshDriver()->MostRecentRefresh(),
|
||||
EnsureStyleRule_IsNotThrottled);
|
||||
curRule.mRule = et->mStyleRule;
|
||||
} else {
|
||||
curRule.mRule = ruleNode->GetRule();
|
||||
@ -616,7 +617,7 @@ CommonElementAnimationData::LogAsyncAnimationFailure(nsCString& aMessage,
|
||||
|
||||
void
|
||||
CommonElementAnimationData::EnsureStyleRuleFor(TimeStamp aRefreshTime,
|
||||
bool aIsThrottled)
|
||||
EnsureStyleRuleFlags aFlags)
|
||||
{
|
||||
if (!mNeedsRefreshes) {
|
||||
mStyleRuleRefreshTime = aRefreshTime;
|
||||
@ -629,7 +630,7 @@ CommonElementAnimationData::EnsureStyleRuleFor(TimeStamp aRefreshTime,
|
||||
// of animation behaviour (the styles of the animation disappear, or the fill
|
||||
// mode behaviour). This loop checks for any finishing animations and forces
|
||||
// the style recalculation if we find any.
|
||||
if (aIsThrottled) {
|
||||
if (aFlags == EnsureStyleRule_IsThrottled) {
|
||||
for (uint32_t animIdx = mAnimations.Length(); animIdx-- != 0; ) {
|
||||
ElementAnimation* anim = mAnimations[animIdx];
|
||||
|
||||
@ -653,13 +654,13 @@ CommonElementAnimationData::EnsureStyleRuleFor(TimeStamp aRefreshTime,
|
||||
(computedTiming.mPhase == ComputedTiming::AnimationPhase_After &&
|
||||
anim->mLastNotification != ElementAnimation::LAST_NOTIFICATION_END))
|
||||
{
|
||||
aIsThrottled = false;
|
||||
aFlags = EnsureStyleRule_IsNotThrottled;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (aIsThrottled) {
|
||||
if (aFlags == EnsureStyleRule_IsThrottled) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -387,6 +387,11 @@ public:
|
||||
|
||||
typedef InfallibleTArray<nsRefPtr<ElementAnimation> > ElementAnimationPtrArray;
|
||||
|
||||
enum EnsureStyleRuleFlags {
|
||||
EnsureStyleRule_IsThrottled,
|
||||
EnsureStyleRule_IsNotThrottled
|
||||
};
|
||||
|
||||
namespace css {
|
||||
|
||||
struct CommonElementAnimationData : public PRCList
|
||||
@ -425,7 +430,7 @@ struct CommonElementAnimationData : public PRCList
|
||||
// for changes to values (for example, nsAnimationManager provides
|
||||
// CheckNeedsRefresh to register or unregister from observing the refresh
|
||||
// driver when this value changes).
|
||||
void EnsureStyleRuleFor(TimeStamp aRefreshTime, bool aIsThrottled);
|
||||
void EnsureStyleRuleFor(TimeStamp aRefreshTime, EnsureStyleRuleFlags aFlags);
|
||||
|
||||
bool CanThrottleTransformChanges(mozilla::TimeStamp aTime);
|
||||
|
||||
|
@ -250,7 +250,7 @@ void
|
||||
nsAnimationManager::EnsureStyleRuleFor(ElementAnimations* aEA)
|
||||
{
|
||||
TimeStamp refreshTime = mPresContext->RefreshDriver()->MostRecentRefresh();
|
||||
aEA->EnsureStyleRuleFor(refreshTime, false);
|
||||
aEA->EnsureStyleRuleFor(refreshTime, EnsureStyleRule_IsNotThrottled);
|
||||
aEA->GetEventsAt(refreshTime, mPendingEvents);
|
||||
CheckNeedsRefresh();
|
||||
}
|
||||
@ -414,7 +414,7 @@ nsAnimationManager::CheckAnimationRule(nsStyleContext* aStyleContext,
|
||||
ea->mAnimations.SwapElements(newAnimations);
|
||||
ea->mNeedsRefreshes = true;
|
||||
|
||||
ea->EnsureStyleRuleFor(refreshTime, false);
|
||||
ea->EnsureStyleRuleFor(refreshTime, EnsureStyleRule_IsNotThrottled);
|
||||
ea->GetEventsAt(refreshTime, mPendingEvents);
|
||||
CheckNeedsRefresh();
|
||||
// We don't actually dispatch the mPendingEvents now. We'll either
|
||||
@ -844,7 +844,9 @@ nsAnimationManager::FlushAnimations(FlushFlags aFlags)
|
||||
ea->CanThrottleAnimation(now);
|
||||
|
||||
nsRefPtr<css::AnimValuesStyleRule> oldStyleRule = ea->mStyleRule;
|
||||
ea->EnsureStyleRuleFor(now, canThrottleTick);
|
||||
ea->EnsureStyleRuleFor(now, canThrottleTick
|
||||
? EnsureStyleRule_IsThrottled
|
||||
: EnsureStyleRule_IsNotThrottled);
|
||||
ea->GetEventsAt(now, mPendingEvents);
|
||||
CheckNeedsRefresh();
|
||||
if (oldStyleRule != ea->mStyleRule) {
|
||||
|
@ -793,7 +793,7 @@ nsTransitionManager::WalkTransitionRule(ElementDependentRuleProcessorData* aData
|
||||
et->mNeedsRefreshes = true;
|
||||
et->EnsureStyleRuleFor(
|
||||
aData->mPresContext->RefreshDriver()->MostRecentRefresh(),
|
||||
false);
|
||||
EnsureStyleRule_IsNotThrottled);
|
||||
|
||||
if (et->mStyleRule) {
|
||||
aData->mRuleWalker->Forward(et->mStyleRule);
|
||||
|
Loading…
Reference in New Issue
Block a user