mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1109390 part 12 - Update IsPaused to handle pause-pending players as well; r=jwatt
IsPaused is used in nsAnimationManager to detect if a newly created animation should be paused. It is also used inside AnimationPlayer::IsRunning which is used to determine what animations to send to the compositor (we don't send paused animations to the compositor). In all these cases we want to treat paused animations and pause-pending animations alike. This patch updates IsPaused to include also pause-pending animations. At the same time it renames IsPaused to IsPausedOrPausing to reflect the change in behavior. This patch also adjusts a few nearby one-line functions to put the opening brace on a new line since apparently this is what the coding style says to do.
This commit is contained in:
parent
dac04008f3
commit
48876aabca
@ -349,7 +349,9 @@ AnimationPlayer::Cancel()
|
||||
bool
|
||||
AnimationPlayer::IsRunning() const
|
||||
{
|
||||
if (IsPaused() || !GetSource() || GetSource()->IsFinishedTransition()) {
|
||||
if (IsPausedOrPausing() ||
|
||||
!GetSource() ||
|
||||
GetSource()->IsFinishedTransition()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -191,17 +191,24 @@ public:
|
||||
|
||||
void Cancel();
|
||||
|
||||
const nsString& Name() const {
|
||||
const nsString& Name() const
|
||||
{
|
||||
return mSource ? mSource->Name() : EmptyString();
|
||||
}
|
||||
|
||||
bool IsPaused() const { return PlayState() == AnimationPlayState::Paused; }
|
||||
bool IsPausedOrPausing() const
|
||||
{
|
||||
return PlayState() == AnimationPlayState::Paused ||
|
||||
mPendingState == PendingState::PausePending;
|
||||
}
|
||||
bool IsRunning() const;
|
||||
|
||||
bool HasCurrentSource() const {
|
||||
bool HasCurrentSource() const
|
||||
{
|
||||
return GetSource() && GetSource()->IsCurrent();
|
||||
}
|
||||
bool HasInEffectSource() const {
|
||||
bool HasInEffectSource() const
|
||||
{
|
||||
return GetSource() && GetSource()->IsInEffect();
|
||||
}
|
||||
|
||||
|
@ -348,11 +348,12 @@ nsAnimationManager::CheckAnimationRule(nsStyleContext* aStyleContext,
|
||||
// (We should check newPlayer->IsStylePaused() but that requires
|
||||
// downcasting to CSSAnimationPlayer and we happen to know that
|
||||
// newPlayer will only ever be paused by calling PauseFromStyle
|
||||
// making IsPaused synonymous in this case.)
|
||||
if (!oldPlayer->IsStylePaused() && newPlayer->IsPaused()) {
|
||||
// making IsPausedOrPausing synonymous in this case.)
|
||||
if (!oldPlayer->IsStylePaused() && newPlayer->IsPausedOrPausing()) {
|
||||
oldPlayer->PauseFromStyle();
|
||||
animationChanged = true;
|
||||
} else if (oldPlayer->IsStylePaused() && !newPlayer->IsPaused()) {
|
||||
} else if (oldPlayer->IsStylePaused() &&
|
||||
!newPlayer->IsPausedOrPausing()) {
|
||||
oldPlayer->PlayFromStyle();
|
||||
animationChanged = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user