mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 880596 part 3 - Remove ElementPropertyTransition::IsRunningAt and mIsRunningOnCompositor; r=dbaron
Both ElementPropertyTransition and ElementAnimation specify an IsRunningAt method which have the same purpose but with two subtle differences: a) ElementPropertyTransition::IsRunningAt checks if the transition is a removed sentinel and if so returns false. This patch adds a check for a null start time to IsRunningAt since I think in future we will want to allow null times in various places to represent, for example, animations that are not connected to a timeline. (However, ultimately we will probably not allow start times on *animations* to be null, only on their associated player.) Should we later use a different mechanism for marking sentinel transitions (e.g. a boolean flag) this method should still be correct as it checks if aTime is inside the transition interval before returning true. b) ElementPropertyTransition::IsRunningAt returns false if the transition is in the delay phase, that is, waiting to start. This patch changes this behavior so that transitions are considered running even if they are in the delay phase. This brings their behavior into line with animations and removes the need for the ElementPropertyTransition::mIsRunningOnCompositor since it is only used to determine when a transition in the delay phase has begun. ElementAnimation::IsRunningAt also handles pause state and iterations but this logic should still be correct for transitions which, in this area, only use a subset of the functionality of animations since their pause state is always playing and their iteration count is 1.
This commit is contained in:
parent
400ebf0c64
commit
165671f347
@ -328,7 +328,8 @@ ElementAnimations::EnsureStyleRuleFor(TimeStamp aRefreshTime,
|
||||
bool
|
||||
ElementAnimation::IsRunningAt(TimeStamp aTime) const
|
||||
{
|
||||
if (IsPaused() || mIterationDuration.ToMilliseconds() <= 0.0) {
|
||||
if (IsPaused() || mIterationDuration.ToMilliseconds() <= 0.0 ||
|
||||
mStartTime.IsNull()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -132,13 +132,6 @@ ElementTransitions::EnsureStyleRuleFor(TimeStamp aRefreshTime)
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
ElementPropertyTransition::IsRunningAt(TimeStamp aTime) const {
|
||||
return !IsRemovedSentinel() &&
|
||||
mStartTime + mDelay <= aTime &&
|
||||
aTime < mStartTime + mDelay + mIterationDuration;
|
||||
}
|
||||
|
||||
bool
|
||||
ElementTransitions::HasAnimationOfProperty(nsCSSProperty aProperty) const
|
||||
{
|
||||
|
@ -26,10 +26,6 @@ struct ElementDependentRuleProcessorData;
|
||||
|
||||
struct ElementPropertyTransition : public ElementAnimation
|
||||
{
|
||||
ElementPropertyTransition()
|
||||
: mIsRunningOnCompositor(false)
|
||||
{}
|
||||
|
||||
// This is the start value to be used for a check for whether a
|
||||
// transition is being reversed. Normally the same as
|
||||
// mProperties[0].mSegments[0].mFromValue, except when this transition
|
||||
@ -46,10 +42,6 @@ struct ElementPropertyTransition : public ElementAnimation
|
||||
// in again when the transition is back to 2px, the mReversePortion
|
||||
// for the third transition (from 0px/2px to 10px) will be 0.8.
|
||||
double mReversePortion;
|
||||
// true when the transition is running on the compositor. In particular,
|
||||
// mIsRunningOnCompositor will be false if the transition has a delay that we
|
||||
// have not yet completed, so there is no animation on the layer.
|
||||
bool mIsRunningOnCompositor;
|
||||
|
||||
// Compute the portion of the *value* space that we should be through
|
||||
// at the given time. (The input to the transition timing function
|
||||
@ -58,6 +50,8 @@ struct ElementPropertyTransition : public ElementAnimation
|
||||
|
||||
bool IsRemovedSentinel() const
|
||||
{
|
||||
// Note that ElementAnimation::IsRunningAt depends on removed sentinels
|
||||
// being represented by a null mStartTime.
|
||||
return mStartTime.IsNull();
|
||||
}
|
||||
|
||||
@ -66,8 +60,6 @@ struct ElementPropertyTransition : public ElementAnimation
|
||||
// assign the null time stamp
|
||||
mStartTime = mozilla::TimeStamp();
|
||||
}
|
||||
|
||||
bool IsRunningAt(mozilla::TimeStamp aTime) const;
|
||||
};
|
||||
|
||||
struct ElementTransitions MOZ_FINAL
|
||||
|
Loading…
Reference in New Issue
Block a user