mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1188251 part 9 - Request restyles from Animation::Tick; r=dholbert
In preparation for ultimately being able to run animations without a manager, this patch moves the request restyle code from FlushAnimations to Animation::Tick. (Ultimately most of this functionality should move to the KeyframeEffect but for now Animation is fine.)
This commit is contained in:
parent
7c975ccea1
commit
64a877c128
@ -374,6 +374,14 @@ Animation::Tick()
|
||||
}
|
||||
|
||||
UpdateTiming(SeekFlag::NoSeek, SyncNotifyFlag::Async);
|
||||
|
||||
// FIXME: Detect the no-change case and don't request a restyle at all
|
||||
AnimationCollection* collection = GetCollection();
|
||||
if (collection) {
|
||||
collection->RequestRestyle(CanThrottle() ?
|
||||
AnimationCollection::RestyleType::Throttled :
|
||||
AnimationCollection::RestyleType::Standard);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -391,19 +391,12 @@ CommonAnimationManager::FlushAnimations(FlushFlags aFlags)
|
||||
continue;
|
||||
}
|
||||
|
||||
nsAutoAnimationMutationBatch mb(collection->mElement);
|
||||
collection->Tick();
|
||||
|
||||
bool canThrottleTick = aFlags == Can_Throttle;
|
||||
for (auto iter = collection->mAnimations.cbegin();
|
||||
canThrottleTick && iter != collection->mAnimations.cend();
|
||||
++iter) {
|
||||
canThrottleTick &= (*iter)->CanThrottle();
|
||||
if (aFlags == Cannot_Throttle) {
|
||||
collection->RequestRestyle(AnimationCollection::RestyleType::Standard);
|
||||
}
|
||||
|
||||
collection->RequestRestyle(canThrottleTick ?
|
||||
AnimationCollection::RestyleType::Throttled :
|
||||
AnimationCollection::RestyleType::Standard);
|
||||
nsAutoAnimationMutationBatch mb(collection->mElement);
|
||||
collection->Tick();
|
||||
}
|
||||
|
||||
MaybeStartOrStopObservingRefreshDriver();
|
||||
|
Loading…
Reference in New Issue
Block a user