зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1031319 part 1 - Don't generate element animations when animation-name is "none"; r=dbaron
This patch causes animations whose corresponding animation-name is "none" to be dropped from the list of generated ElementAnimation objects. This means we avoid generating events for these animations.
This commit is contained in:
Родитель
a28f62b5ce
Коммит
a2d236894b
|
@ -375,7 +375,7 @@ public:
|
||||||
// Return the duration of the active interval for the given timing parameters.
|
// Return the duration of the active interval for the given timing parameters.
|
||||||
static mozilla::TimeDuration ActiveDuration(const AnimationTiming& aTiming);
|
static mozilla::TimeDuration ActiveDuration(const AnimationTiming& aTiming);
|
||||||
|
|
||||||
nsString mName; // empty string for 'none'
|
nsString mName;
|
||||||
AnimationTiming mTiming;
|
AnimationTiming mTiming;
|
||||||
// The beginning of the delay period. This is also set to a null
|
// The beginning of the delay period. This is also set to a null
|
||||||
// timestamp to mark transitions that have finished and are due to
|
// timestamp to mark transitions that have finished and are due to
|
||||||
|
|
|
@ -394,6 +394,15 @@ nsAnimationManager::BuildAnimations(nsStyleContext* aStyleContext,
|
||||||
for (uint32_t animIdx = 0, animEnd = disp->mAnimationNameCount;
|
for (uint32_t animIdx = 0, animEnd = disp->mAnimationNameCount;
|
||||||
animIdx != animEnd; ++animIdx) {
|
animIdx != animEnd; ++animIdx) {
|
||||||
const StyleAnimation& src = disp->mAnimations[animIdx];
|
const StyleAnimation& src = disp->mAnimations[animIdx];
|
||||||
|
|
||||||
|
// CSS Animations with an animation-name of "none" are represented
|
||||||
|
// by StyleAnimations with an empty name. Unlike animations with an empty
|
||||||
|
// keyframes rule, these "none" animations should not generate events
|
||||||
|
// at all so we drop them here.
|
||||||
|
if (src.GetName().IsEmpty()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
nsRefPtr<ElementAnimation> dest =
|
nsRefPtr<ElementAnimation> dest =
|
||||||
*aAnimations.AppendElement(new ElementAnimation());
|
*aAnimations.AppendElement(new ElementAnimation());
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче