Open Bug 1885554 Opened 11 months ago Updated 10 months ago

em unit not correctly resolved when used inside @keyframes

Categories

(Core :: CSS Transitions and Animations, defect)

Firefox 116
defect

Tracking

()

People

(Reporter: tobias.bengfort, Unassigned)

References

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0

Steps to reproduce:

When font-size is animated using @keyframes, em units used outside of the keyframes are computed against the animated font-size, but em units used inside the same keyframes are not. Example: https://codepen.io/xi-the-bashful/pen/oNOzKPL

Component: Layout: Text and Fonts → CSS Transitions and Animations

Thanks for the bug report. Good/bad news, this doesn't seem to be a regression; I can reproduce the bug at least as far back as Nightly 2018-01-01 (version 59.0a1). (If I go another year back, the right border simply never appears.)

Boris/hiro, do you happen to know if we have a bug filed on this already?

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attachment #9391489 - Attachment description: reduced testcsae 1 (based on reporter's codepen) → reduced testcsae 1 (based on reporter's codepen) - expectation is for blue border to grow just like the red border does

I cannot find a related bug for this in Bugzilla. Thanks for filing this bug.

If my memory was correct, the font size resolution happens while we parse/resolve the keyframes, i.e. while we are generating the CSS animation, and it was compliant with the spec. But things might have been changed.

I thought font size resolution was known not to be correct in some cases but we decided not to fix it until we implemented custom property animations because both custom properties and font sizes would require some sort of cyclic dependency detection (or at least very careful ordering of evaluation) and we figured it would be easiest to fix it properly all at once.

See Also: → 1885751

(In reply to Brian Birtles (:birtles, Feb 26~ parental leave) from comment #5)

...both custom properties and font sizes would require some sort of cyclic dependency detection (or at least very careful ordering of evaluation)

Cycle detection might not be the right concept here. I just recall talking to the chromium engineer who implemented animation of custom properties in Blink and he mentioned that getting the dependency chain was involved. I'm not sure if you need to build up a graph of dependencies or not but I got the impression there was a bit of complexity there.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: