| Index: Source/core/animation/KeyframeEffect.cpp
|
| diff --git a/Source/core/animation/KeyframeEffect.cpp b/Source/core/animation/KeyframeEffect.cpp
|
| index 0afa07e9837f71cf7e403be29b4d57eaf5ac9465..fff522767343d9087a9ffb5898549c8f6ff27fb0 100644
|
| --- a/Source/core/animation/KeyframeEffect.cpp
|
| +++ b/Source/core/animation/KeyframeEffect.cpp
|
| @@ -140,11 +140,14 @@ void KeyframeEffect::applyEffects()
|
| // rotate or scale operation has been introduced on the element.
|
| if (m_target->computedStyle()
|
| && (m_target->computedStyle()->hasMotionPath()
|
| - || m_target->computedStyle()->translate()
|
| || m_target->computedStyle()->rotate()
|
| - || m_target->computedStyle()->scale())
|
| + || m_target->computedStyle()->scale()
|
| + || m_target->computedStyle()->translate())
|
| && animation()->hasActiveAnimationsOnCompositor()
|
| - && animation()->affects(*m_target, CSSPropertyTransform)) {
|
| + && (animation()->affects(*m_target, CSSPropertyScale)
|
| + || animation()->affects(*m_target, CSSPropertyRotate)
|
| + || animation()->affects(*m_target, CSSPropertyTransform)
|
| + || animation()->affects(*m_target, CSSPropertyTranslate))) {
|
| animation()->cancelAnimationOnCompositor();
|
| }
|
|
|
| @@ -246,9 +249,25 @@ bool KeyframeEffect::isCandidateForAnimationOnCompositor(double animationPlaybac
|
| {
|
| if (!model()
|
| || !m_target
|
| - || (m_target->computedStyle() && (m_target->computedStyle()->hasMotionPath() || m_target->computedStyle()->translate() || m_target->computedStyle()->rotate() || m_target->computedStyle()->scale())))
|
| + || (m_target->computedStyle() && m_target->computedStyle()->hasMotionPath()))
|
| return false;
|
|
|
| + // Do not put transforms on compositor if more than one of them are defined
|
| + // in computed style because they need to be explicitly ordered
|
| + if (m_target->computedStyle()) {
|
| + unsigned transformOperationsCount = 0;
|
| + if (m_target->computedStyle()->hasTransformOperations())
|
| + transformOperationsCount++;
|
| + if (m_target->computedStyle()->rotate())
|
| + transformOperationsCount++;
|
| + if (m_target->computedStyle()->scale())
|
| + transformOperationsCount++;
|
| + if (m_target->computedStyle()->translate())
|
| + transformOperationsCount++;
|
| + if (transformOperationsCount > 1)
|
| + return false;
|
| + }
|
| +
|
| return CompositorAnimations::instance()->isCandidateForAnimationOnCompositor(specifiedTiming(), *m_target, animation(), *model(), animationPlaybackRate);
|
| }
|
|
|
|
|