Currently KeyframeEffect::setKeyframes just calls KeyframeEffectModelBase::SetFrames, which as per the comment at https://codesearch.chromium.org/chromium/src/third_party/blink/renderer/core/animation/keyframe_effect_model.cc?l=61&rcl=ff8ac07365b339290a799c776f877db74dcc1c47 doesn't invalidate the Animation at all. This means that composited Animations will never pick up the changed keyframes. See the test case at http://output.jsbin.com/silivem/
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/5f7b4c115a571f47ebe484ae1382d95fc5418018 commit 5f7b4c115a571f47ebe484ae1382d95fc5418018 Author: Stephen McGruer <smcgruer@chromium.org> Date: Fri Apr 27 20:20:59 2018 Make KeyframeEffectReadOnly::setKeyframes take effect immediately Previously we wouldn't notice that the keyframes had changed until the next animation update. This CL fixes that by clearing any cached sampled effects and notifying the owning Animation that it needs to invalidate it's information. This also fixes updating composited animations; invalidating the effect on the animation causes us to properly restart the composited animation. Bug: 799061, 835824 Change-Id: Ib307a5409c52c5dab1ee0f98c989d7dbaef42937 Reviewed-on: https://chromium-review.googlesource.com/1026700 Commit-Queue: Stephen McGruer <smcgruer@chromium.org> Reviewed-by: Majid Valipour <majidvp@chromium.org> Cr-Commit-Position: refs/heads/master@{#554484} [modify] https://crrev.com/5f7b4c115a571f47ebe484ae1382d95fc5418018/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/setKeyframes-expected.txt [modify] https://crrev.com/5f7b4c115a571f47ebe484ae1382d95fc5418018/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/setKeyframes.html [modify] https://crrev.com/5f7b4c115a571f47ebe484ae1382d95fc5418018/third_party/blink/renderer/core/animation/animation.cc [modify] https://crrev.com/5f7b4c115a571f47ebe484ae1382d95fc5418018/third_party/blink/renderer/core/animation/animation.h [modify] https://crrev.com/5f7b4c115a571f47ebe484ae1382d95fc5418018/third_party/blink/renderer/core/animation/animation_effect.cc [modify] https://crrev.com/5f7b4c115a571f47ebe484ae1382d95fc5418018/third_party/blink/renderer/core/animation/animation_effect.h [modify] https://crrev.com/5f7b4c115a571f47ebe484ae1382d95fc5418018/third_party/blink/renderer/core/animation/animation_effect_owner.h [modify] https://crrev.com/5f7b4c115a571f47ebe484ae1382d95fc5418018/third_party/blink/renderer/core/animation/animation_effect_test.cc [modify] https://crrev.com/5f7b4c115a571f47ebe484ae1382d95fc5418018/third_party/blink/renderer/core/animation/animation_test.cc [modify] https://crrev.com/5f7b4c115a571f47ebe484ae1382d95fc5418018/third_party/blink/renderer/core/animation/keyframe_effect.cc [modify] https://crrev.com/5f7b4c115a571f47ebe484ae1382d95fc5418018/third_party/blink/renderer/core/animation/keyframe_effect.h [modify] https://crrev.com/5f7b4c115a571f47ebe484ae1382d95fc5418018/third_party/blink/renderer/modules/animationworklet/worklet_animation.h
Comment 1 by smcgruer@chromium.org
, Apr 23 2018