If an animation's keyframes affect stacking context properties, create stacking conte...
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Oct 2016 03:20:32 +0000 (03:20 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Oct 2016 03:20:32 +0000 (03:20 +0000)
commit17e37d0b36970589c2cfe295dd41527a03d16970
treecb221230d75d1abad177a8d26dbc0998aee08424
parent225ff3c5404c29acca1ee1dd465f6676ef8183b4
If an animation's keyframes affect stacking context properties, create stacking context while the animation is running
https://bugs.webkit.org/show_bug.cgi?id=164094

Reviewed by Dean Jackson.

Source/WebCore:

The CSS animations spec <https://drafts.csswg.org/css-animations-1/> now makes it
clear that a keyframe animation animating properties which can affect stacking context
should establish stacking context while it's running, or filling-forwards. This is part
of the "the user agent must act as if the will-change property...includes all the properties
animated by the animation" clause.

Implement by having CompositeAnimation::animate() track whether running animations should
create stacking context, replacing existing code in AnimationController::updateAnimations()
which only looked at opacity and transform. Transitions are also checked to see if they need
to trigger stacking context.

This allows for the removal of a 0.9999 hack when blending opacity.

Tests: animations/stacking-context-fill-forwards.html
       animations/stacking-context-not-fill-forwards.html
       animations/stacking-context-unchanged-while-running.html

* page/animation/AnimationController.cpp:
(WebCore::AnimationController::updateAnimations):
* page/animation/CSSPropertyAnimation.cpp:
* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::animate):
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::KeyframeAnimation):
(WebCore::KeyframeAnimation::computeStackingContextImpact):
(WebCore::KeyframeAnimation::animate):
* page/animation/KeyframeAnimation.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::currentTransform):
* rendering/style/WillChangeData.cpp:
(WebCore::WillChangeData::propertyCreatesStackingContext):
(WebCore::propertyCreatesStackingContext): Deleted.
* rendering/style/WillChangeData.h:

LayoutTests:

* animations/stacking-context-fill-forwards-expected.html: Added.
* animations/stacking-context-fill-forwards.html: Added.
* animations/stacking-context-not-fill-forwards-expected.html: Added.
* animations/stacking-context-not-fill-forwards.html: Added.
* animations/stacking-context-unchanged-while-running-expected.html: Added.
* animations/stacking-context-unchanged-while-running.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208025 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
LayoutTests/ChangeLog
LayoutTests/animations/stacking-context-fill-forwards-expected.html [new file with mode: 0644]
LayoutTests/animations/stacking-context-fill-forwards.html [new file with mode: 0644]
LayoutTests/animations/stacking-context-not-fill-forwards-expected.html [new file with mode: 0644]
LayoutTests/animations/stacking-context-not-fill-forwards.html [new file with mode: 0644]
LayoutTests/animations/stacking-context-unchanged-while-running-expected.html [new file with mode: 0644]
LayoutTests/animations/stacking-context-unchanged-while-running.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/animation/AnimationController.cpp
Source/WebCore/page/animation/CSSPropertyAnimation.cpp
Source/WebCore/page/animation/CompositeAnimation.cpp
Source/WebCore/page/animation/KeyframeAnimation.cpp
Source/WebCore/page/animation/KeyframeAnimation.h
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/style/WillChangeData.cpp
Source/WebCore/rendering/style/WillChangeData.h