зеркало из https://github.com/mozilla/gecko-dev.git
Bug 960465 patch 3 - Use style without animation for base values for CSS animations (refixes bug 686656 in the new architecture). r=birtles
This is needed to make the tests for bug 686656 in test_animations.html pass. Note that once the rest of bug 960465 happens this will start producing slightly different results in edge cases, since we will only be skipping animation styles for the element itself and not for ancestors. However, both old and new behaviors are incorrect, since per spec we should be updating the base values dynamically (bug 1064915).
This commit is contained in:
Родитель
4eedf5bf60
Коммит
ccbaeaf9e9
|
@ -428,6 +428,8 @@ nsAnimationManager::BuildAnimations(nsStyleContext* aStyleContext,
|
|||
|
||||
const nsStyleDisplay *disp = aStyleContext->StyleDisplay();
|
||||
|
||||
nsRefPtr<nsStyleContext> styleWithoutAnimation;
|
||||
|
||||
for (size_t animIdx = 0, animEnd = disp->mAnimationNameCount;
|
||||
animIdx != animEnd; ++animIdx) {
|
||||
const StyleAnimation& src = disp->mAnimations[animIdx];
|
||||
|
@ -580,9 +582,14 @@ nsAnimationManager::BuildAnimations(nsStyleContext* aStyleContext,
|
|||
if (toKeyframe.mKey != 0.0f) {
|
||||
// There's no data for this property at 0%, so use the
|
||||
// cascaded value above us.
|
||||
if (!styleWithoutAnimation) {
|
||||
styleWithoutAnimation = mPresContext->StyleSet()->
|
||||
ResolveStyleWithoutAnimation(aTarget, aStyleContext,
|
||||
eRestyle_ChangeAnimationPhase);
|
||||
}
|
||||
interpolated = interpolated &&
|
||||
BuildSegment(propData.mSegments, prop, src,
|
||||
0.0f, aStyleContext, nullptr,
|
||||
0.0f, styleWithoutAnimation, nullptr,
|
||||
toKeyframe.mKey, toContext);
|
||||
}
|
||||
}
|
||||
|
@ -594,11 +601,16 @@ nsAnimationManager::BuildAnimations(nsStyleContext* aStyleContext,
|
|||
if (fromKeyframe->mKey != 1.0f) {
|
||||
// There's no data for this property at 100%, so use the
|
||||
// cascaded value above us.
|
||||
if (!styleWithoutAnimation) {
|
||||
styleWithoutAnimation = mPresContext->StyleSet()->
|
||||
ResolveStyleWithoutAnimation(aTarget, aStyleContext,
|
||||
eRestyle_ChangeAnimationPhase);
|
||||
}
|
||||
interpolated = interpolated &&
|
||||
BuildSegment(propData.mSegments, prop, src,
|
||||
fromKeyframe->mKey, fromContext,
|
||||
fromKeyframe->mRule->Declaration(),
|
||||
1.0f, aStyleContext);
|
||||
1.0f, styleWithoutAnimation);
|
||||
}
|
||||
|
||||
// If we failed to build any segments due to inability to
|
||||
|
|
Загрузка…
Ссылка в новой задаче