Bug 251022 - Web Animation API does not update root CSS Variables
Summary: Web Animation API does not update root CSS Variables
Status: RESOLVED DUPLICATE of bug 210963
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari 16
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: BrowserCompat, InRadar
Depends on:
Blocks:
 
Reported: 2023-01-23 10:01 PST by Carlos Lopez
Modified: 2023-01-24 10:03 PST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Lopez 2023-01-23 10:01:46 PST
When using Web Animation API to update CSS Variables, root CSS variables are not updated. Child elements do reflect updated variables. commitStyles() works (but would violate inline-style csp).

eg: 

box3
  .animate([{
    '--background-color': 'gray',
    '--color': 'blue',
  }], {
    duration: 0,
    fill: 'forwards',
  });

See codepen: https://codepen.io/shortfuse/pen/JjBpeQX

For comparison, all tests pass on Chrome and no CSS Variable related tests pass on Firefox.
Comment 1 Karl Dubost 2023-01-23 19:33:14 PST
From https://codepen.io/shortfuse/pen/JjBpeQX

Background-Color = Root
Foreground-Color = Child

Feature	Result
1. Root CSS Property	
2. Child CSS Property	
3 Root CSS Variable	
4. Child CSS Variable	
5. Commited Root CSS Variable	
6. Commited Child CSS Variable	

        1  2  3  4  5  6 
Safari  P  P  X  P  P  P
Firefox P  P  X  X  X  X
Chrome  P  P  P  P  P  P

P PASS
X FAIL


Probably part of Bug 235138
Comment 2 Radar WebKit Bug Importer 2023-01-23 19:33:37 PST
<rdar://problem/104584506>
Comment 3 Antoine Quint 2023-01-24 10:03:17 PST
This is already fixed on ToT, specifically this progressed with 258514@main. Dupe of bug 210963.

*** This bug has been marked as a duplicate of bug 210963 ***