WebKit Bugzilla
Attachment 349306 Details for
Bug 189411
: [Web Animations] Positive delays of accelerated animations are not respected
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189411-20180910121327.patch (text/plain), 5.66 KB, created by
Antoine Quint
on 2018-09-10 03:13:28 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Antoine Quint
Created:
2018-09-10 03:13:28 PDT
Size:
5.66 KB
patch
obsolete
>Subversion Revision: 235843 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 7ce60b1e0d9f4bb16787112cefc93788cfe5ba67..a925b60b25019d49215ed3f211bcc0f90eebc5fd 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,23 @@ >+2018-09-10 Antoine Quint <graouts@apple.com> >+ >+ [Web Animations] Positive delays of accelerated animations are not respected >+ https://bugs.webkit.org/show_bug.cgi?id=189411 >+ <rdar://problem/44151416> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Test: webanimations/accelerated-animation-with-delay-and-seek.html >+ >+ We were only accounting for negative delays for accelerated actions. We also were misbehaving >+ when seeking an animation with a delay (positive or negative) since we wouldn't reset the animation >+ begin time to be the current time when adjusting its time offset, while the begin time set when >+ first creating the animation would be set accounting for the time offset. >+ >+ * animation/KeyframeEffectReadOnly.cpp: >+ (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions): >+ * platform/graphics/ca/GraphicsLayerCA.cpp: >+ (WebCore::GraphicsLayerCA::seekCAAnimationOnLayer): >+ > 2018-09-10 Antoine Quint <graouts@apple.com> > > [Web Animations] Interrupting an accelerated CSS transition on a composited element in flight fails >diff --git a/Source/WebCore/animation/KeyframeEffectReadOnly.cpp b/Source/WebCore/animation/KeyframeEffectReadOnly.cpp >index 135adddaf53c8e7a47f0ec11767b655faaff8200..0fe00d87439a83aa19b2c8edb554265e89583e6b 100644 >--- a/Source/WebCore/animation/KeyframeEffectReadOnly.cpp >+++ b/Source/WebCore/animation/KeyframeEffectReadOnly.cpp >@@ -1279,9 +1279,7 @@ void KeyframeEffectReadOnly::applyPendingAcceleratedActions() > auto* compositedRenderer = downcast<RenderBoxModelObject>(renderer); > > // To simplify the code we use a default of 0s for an unresolved current time since for a Stop action that is acceptable. >- auto timeOffset = animation()->currentTime().value_or(0_s).seconds(); >- if (timing()->delay() < 0_s) >- timeOffset = -timing()->delay().seconds(); >+ auto timeOffset = animation()->currentTime().value_or(0_s).seconds() - timing()->delay().seconds(); > > for (const auto& action : pendingAcceleratedActions) { > switch (action) { >diff --git a/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp b/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp >index a47c0944714efbb6db5aafde6b93239bb8e9b881..cf1aa41e8fc6c3bfb5e405d3d22d3601bd4d2dca 100644 >--- a/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp >+++ b/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp >@@ -2972,6 +2972,7 @@ void GraphicsLayerCA::seekCAAnimationOnLayer(AnimatedPropertyID property, const > // Animations on the layer are immutable, so we have to clone and modify. > RefPtr<PlatformCAAnimation> newAnim = currentAnimation->copy(); > >+ newAnim->setBeginTime(CACurrentMediaTime()); > newAnim->setTimeOffset(timeOffset.seconds()); > > layer->addAnimationForKey(animationID, *newAnim); // This will replace the running animation. >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index e03cb263fef0d1718d33761f3b858d53f9700bc3..ff4d267548073e3482f3bde12ca9c9f2dd15b23e 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,16 @@ >+2018-09-10 Antoine Quint <graouts@apple.com> >+ >+ [Web Animations] Positive delays of accelerated animations are not respected >+ https://bugs.webkit.org/show_bug.cgi?id=189411 >+ <rdar://problem/44151416> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add a test that checks that positive delays are accounted for during accelerated actions, including a seek. >+ >+ * webanimations/accelerated-animation-with-delay-and-seek-expected.html: Added. >+ * webanimations/accelerated-animation-with-delay-and-seek.html: Added. >+ > 2018-09-10 Antoine Quint <graouts@apple.com> > > [Web Animations] Interrupting an accelerated CSS transition on a composited element in flight fails >diff --git a/LayoutTests/webanimations/accelerated-animation-with-delay-and-seek-expected.html b/LayoutTests/webanimations/accelerated-animation-with-delay-and-seek-expected.html >new file mode 100644 >index 0000000000000000000000000000000000000000..cf518fe98c60f1ce7682c1008665f2359c04b420 >--- /dev/null >+++ b/LayoutTests/webanimations/accelerated-animation-with-delay-and-seek-expected.html >@@ -0,0 +1,17 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<style> >+div { >+ position: absolute; >+ width: 100px; >+ height: 100px; >+ transform: translateX(50px); >+ background-color: black; >+} >+</style> >+</head> >+<body> >+<div></div> >+</body> >+</html> >diff --git a/LayoutTests/webanimations/accelerated-animation-with-delay-and-seek.html b/LayoutTests/webanimations/accelerated-animation-with-delay-and-seek.html >new file mode 100644 >index 0000000000000000000000000000000000000000..b5fd87a7af863ff731e6fd674ad0b20b8cf4e104 >--- /dev/null >+++ b/LayoutTests/webanimations/accelerated-animation-with-delay-and-seek.html >@@ -0,0 +1,34 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<style> >+ >+div { >+ position: absolute; >+ width: 100px; >+ height: 100px; >+ background-color: black; >+} >+ >+</style> >+</head> >+<body> >+<script> >+ >+if (window.testRunner) >+ testRunner.waitUntilDone(); >+ >+const animation = document.body.appendChild(document.createElement("div")).animate({ >+ transform: ["translateX(100px)", "none"] >+}, { duration: 10000, delay: 1000 }); >+ >+requestAnimationFrame(() => { >+ animation.pause(); >+ animation.currentTime = 6000; >+ if (window.testRunner) >+ requestAnimationFrame(() => testRunner.notifyDone()); >+}); >+ >+</script> >+</body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189411
:
349153
|
349306
|
349880