Closed Bug 1811897 Opened 2 years ago Closed 2 years ago

Web Animation API does not update or commit CSS Variables

Categories

(Core :: DOM: Animation, defect, P3)

Firefox 109
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: clshortfuse, Assigned: zrhoffman)

References

(Blocks 1 open bug)

Details

Steps to reproduce:

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

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

Actual results:

Nothing is changed, even with commitStyles(). [style] attribute is untouched.

Expected results:

Root element variables should change and be reflected.
Child element variables should change and be reflected.

Style attribute should change.

For comparison:

Chrome passes with all cases.
Safari fails with root CSS Variables if not calling commitStyles().

The Bugbug bot thinks this bug should belong to the 'Core::CSS Parsing and Computation' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → CSS Parsing and Computation
Product: Firefox → Core

This code doesn't deal with custom properties. It seems web animations don't deal too well with them more generally tho?

Severity: -- → S3
Status: UNCONFIRMED → NEW
Component: CSS Parsing and Computation → DOM: Animation
Ever confirmed: true
Priority: -- → P3
Blocks: 1813268

(In reply to Emilio Cobos Álvarez (:emilio) from comment #2)

This code doesn't deal with custom properties. It seems web animations don't deal too well with them more generally tho?

In what sense? With regards to commitStyles?

In Gecko we generally haven't paid too much attention to custom properties because we have always been expecting that code to be reworked when we implement Properties and Values API (bug 1273706).

Assignee: nobody → zach
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.