Bug 248145 - [web-animations] keyframes should be recomputed if used CSS variable changes
Summary: [web-animations] keyframes should be recomputed if used CSS variable changes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Animations (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Antoine Quint
URL:
Keywords: InRadar, WebExposed, WPTImpact
: 201736 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-11-20 08:04 PST by Antoine Quint
Modified: 2022-11-29 02:25 PST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Antoine Quint 2022-11-20 08:04:11 PST
We're failing a couple of tests in web-animations/animation-model/keyframe-effects/effect-value-context-filling.html because we fail to update keyframes when a used CSS variable changes. For instance:

test(t => {
  const div = createDiv(t);
  div.style.setProperty('--target', '100px');
  const animation = div.animate(
    [{ marginLeft: '0px' }, { marginLeft: 'var(--target)' }],
    { duration: 1000, fill: 'forwards' }
  );
  animation.finish();
  assert_equals(
    getComputedStyle(div).marginLeft,
    '100px',
    'Effect value before updating variable'
  );

  div.style.setProperty('--target', '200px');

  assert_equals(
    getComputedStyle(div).marginLeft,
    '200px',
    'Effect value after updating variable'
  );
}, 'Filling effect values reflect changes to variables on element');

In fact, after fixing bug 186490, the last two remaining failures in that test are due to this issue.
Comment 1 Antoine Quint 2022-11-20 08:18:06 PST
Pull request: https://github.com/WebKit/WebKit/pull/6682
Comment 2 Antoine Quint 2022-11-20 08:19:47 PST
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/37043
Comment 3 EWS 2022-11-20 12:36:49 PST
Committed 256893@main (5c0b3cb4b245): <https://commits.webkit.org/256893@main>

Reviewed commits have been landed. Closing PR #6682 and removing active labels.
Comment 4 Radar WebKit Bug Importer 2022-11-20 12:37:17 PST
<rdar://problem/102565326>
Comment 5 Antoine Quint 2022-11-29 02:25:11 PST
*** Bug 201736 has been marked as a duplicate of this bug. ***