Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
REGRESSION (r263506): scale transform transitions won't overshoot
https://bugs.webkit.org/show_bug.cgi?id=215826 <rdar://problem/67759310> Reviewed by Simon Fraser. Source/WebCore: Test: webanimations/accelerated-css-transition-with-easing-y-axis-above-1.html In r263506 we made a change where accelerated animations would set their animation-wide timing functions using PlatformCAAnimation::setTimingFunction() instead of setting it on individual keyframes. This change was required to support the unique ability of JS-originated animations to specify both an animation-wide timing function as well as per-keyframe timing functions. In the case of CSS Transitions, this meant that instead of setting a per-keyframe timing function, this change would set the animation-wide timing function since CSS Transitions should map the transition-timing-function property to the "easing" property of the Animation object exposed by the Web Animations API, not as the timing function of the single keyframe interval. However, this change surfaced a bug in Core Animation on macOS and iOS where a cubic-bezier() timing function with y values above 1 get clipped when applied to a CAKeyframeAnimation using the timingFunction property (singular) instead of the timingFunctions property (plural). To work around this issue, we set Animation::property() on the generated Animation object passed to GraphicsLayerCA to make it possible to detect when we're dealing with a CSS Transition and set the timing function on the keyframe interval rather than on the animation itself. Alas, this does not fix the case where a JS-originated animation will specify an animation-wide timing function with a cubic-bezier() timing function with y values above 1. There is no known workaround at this time for this case and this is covered by bug 215918. * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::backingAnimationForCompositedRenderer const): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): LayoutTests: Add a new test that checks that a CSS Transition using a cubic-bezier() timing function with a y value beyond 1 does not get clipped. * platform/win/TestExpectations: * webanimations/accelerated-css-transition-with-easing-y-axis-above-1-expected.html: Added. * webanimations/accelerated-css-transition-with-easing-y-axis-above-1.html: Added. Canonical link: https://commits.webkit.org/228730@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266280 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
7 changed files
with
127 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
...utTests/webanimations/accelerated-css-transition-with-easing-y-axis-above-1-expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<body style="background-color: green"> | ||
</body> |
45 changes: 45 additions & 0 deletions
45
LayoutTests/webanimations/accelerated-css-transition-with-easing-y-axis-above-1.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<body> | ||
<style> | ||
|
||
body { | ||
background-color: red; | ||
} | ||
|
||
div { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 400px; | ||
height: 400px; | ||
background-color: green; | ||
transform-origin: top left; | ||
transform: scale(0.5); | ||
} | ||
|
||
div.scaled-up { | ||
transform: scale(1); | ||
transition: 2s transform cubic-bezier(0, 200, 1, 200); | ||
} | ||
|
||
</style> | ||
<div></div> | ||
<script src="../resources/ui-helper.js"></script> | ||
<script> | ||
|
||
(async function() { | ||
if (window.testRunner) | ||
testRunner.waitUntilDone(); | ||
|
||
await UIHelper.renderingUpdate(); | ||
document.querySelector("div").classList.add("scaled-up"); | ||
|
||
await Promise.all(document.getAnimations().map(animation => animation.ready)); | ||
await UIHelper.ensurePresentationUpdate(); | ||
await UIHelper.renderingUpdate(); | ||
|
||
if (window.testRunner) | ||
testRunner.notifyDone(); | ||
})(); | ||
|
||
</script> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters