mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1073336 part 15 - Switch AnimationPlayer to using less aggressive update mechanism; r=dbaron
This commit is contained in:
parent
b873dee10d
commit
96d8f02aa1
@ -67,7 +67,7 @@ AnimationPlayer::PlayState() const
|
||||
}
|
||||
|
||||
void
|
||||
AnimationPlayer::Play(UpdateFlags aFlags)
|
||||
AnimationPlayer::Play(UpdateFlags aUpdateFlags)
|
||||
{
|
||||
// FIXME: When we implement finishing behavior (bug 1074630) we should
|
||||
// not return early if mIsPaused is false since we may still need to seek.
|
||||
@ -90,13 +90,13 @@ AnimationPlayer::Play(UpdateFlags aFlags)
|
||||
mStartTime.SetValue(timelineTime.Value() - mHoldTime.Value());
|
||||
mHoldTime.SetNull();
|
||||
|
||||
if (aFlags == eUpdateStyle) {
|
||||
MaybePostRestyle();
|
||||
if (aUpdateFlags == eUpdateStyle) {
|
||||
PostUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
AnimationPlayer::Pause(UpdateFlags aFlags)
|
||||
AnimationPlayer::Pause(UpdateFlags aUpdateFlags)
|
||||
{
|
||||
if (mIsPaused) {
|
||||
return;
|
||||
@ -108,8 +108,8 @@ AnimationPlayer::Pause(UpdateFlags aFlags)
|
||||
mHoldTime = GetCurrentTime();
|
||||
mStartTime.SetNull();
|
||||
|
||||
if (aFlags == eUpdateStyle) {
|
||||
MaybePostRestyle();
|
||||
if (aUpdateFlags == eUpdateStyle) {
|
||||
PostUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
@ -119,18 +119,6 @@ AnimationPlayer::GetCurrentTimeAsDouble() const
|
||||
return AnimationUtils::TimeDurationToDouble(GetCurrentTime());
|
||||
}
|
||||
|
||||
void
|
||||
AnimationPlayer::PlayFromJS()
|
||||
{
|
||||
Play(eUpdateStyle);
|
||||
}
|
||||
|
||||
void
|
||||
AnimationPlayer::PauseFromJS()
|
||||
{
|
||||
Pause(eUpdateStyle);
|
||||
}
|
||||
|
||||
void
|
||||
AnimationPlayer::SetSource(Animation* aSource)
|
||||
{
|
||||
@ -215,27 +203,6 @@ AnimationPlayer::FlushStyle() const
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
AnimationPlayer::MaybePostRestyle() const
|
||||
{
|
||||
if (!mSource) {
|
||||
return;
|
||||
}
|
||||
|
||||
Element* targetElement;
|
||||
nsCSSPseudoElements::Type pseudoType;
|
||||
mSource->GetTarget(targetElement, pseudoType);
|
||||
if (!targetElement) {
|
||||
return;
|
||||
}
|
||||
|
||||
// FIXME: This is a bit heavy-handed but in bug 1073336 we hope to
|
||||
// introduce a better means for players to update style.
|
||||
nsLayoutUtils::PostRestyleEvent(targetElement,
|
||||
eRestyle_Self,
|
||||
nsChangeHint_AllReflowHints);
|
||||
}
|
||||
|
||||
void
|
||||
AnimationPlayer::PostUpdate()
|
||||
{
|
||||
|
@ -60,8 +60,6 @@ public:
|
||||
virtual CSSAnimationPlayer* AsCSSAnimationPlayer() { return nullptr; }
|
||||
virtual CSSTransitionPlayer* AsCSSTransitionPlayer() { return nullptr; }
|
||||
|
||||
// Temporary flags to control restyle behavior until bug 1073336
|
||||
// provides a better solution.
|
||||
enum UpdateFlags {
|
||||
eNoUpdate,
|
||||
eUpdateStyle
|
||||
@ -83,8 +81,8 @@ public:
|
||||
// as flushing style or converting the return type.
|
||||
Nullable<double> GetCurrentTimeAsDouble() const;
|
||||
virtual AnimationPlayState PlayStateFromJS() const { return PlayState(); }
|
||||
virtual void PlayFromJS();
|
||||
void PauseFromJS();
|
||||
virtual void PlayFromJS() { Play(eUpdateStyle); }
|
||||
void PauseFromJS() { Pause(eUpdateStyle); }
|
||||
|
||||
void SetSource(Animation* aSource);
|
||||
void Tick();
|
||||
@ -127,7 +125,6 @@ public:
|
||||
|
||||
protected:
|
||||
void FlushStyle() const;
|
||||
void MaybePostRestyle() const;
|
||||
void PostUpdate();
|
||||
StickyTimeDuration SourceContentEnd() const;
|
||||
|
||||
|
@ -206,8 +206,6 @@ async_test(function(t) {
|
||||
}, 'pause() applies pending changes to animation-play-state first');
|
||||
// (Note that we can't actually test for this; see comment above, in test-body.)
|
||||
|
||||
/* Disabled until bug 1073336 lands */
|
||||
if (false) {
|
||||
async_test(function(t) {
|
||||
var div = addDiv();
|
||||
var cs = window.getComputedStyle(div);
|
||||
@ -248,6 +246,5 @@ async_test(function(t) {
|
||||
t.done();
|
||||
});
|
||||
}, 'pause() and play() a transition');
|
||||
}
|
||||
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user