Skip to content

[css-animations] Negative time at start of animation shorthand #4034

@ewilligers

Description

@ewilligers

https://drafts.csswg.org/css-animations/#animation

"the first value in each <single-animation> that can be parsed as a <time> is assigned to the animation-duration, and the second value in each <single-animation> that can be parsed as a <time> is assigned to animation-delay."

Negative <time> values are invalid for animation-duration.

Does this mean that if a negative <time> (like '-5s') appears at the start of animation, the shorthand value is invalid?

Spec (possible reading):
The negative value is rejected as it is only considered for animation-duration.
Reading the specified animation gives ''.
Reading computed animation gives values from style rules, or initial values.

Edge 18:
The negative value is accepted as animation-duration.
Reading the specified animation gives '-5s'.
Reading computed animation gives ''.

Safari:
The negative value is accepted as animation-delay.
Reading the specified animation gives '-5s'.
Reading computed animation gives ''.

Firefox:
The negative value is accepted as animation-delay.
Reading the specified animation gives '0s ease -5s 1 normal none running none'.
Reading computed animation gives ''.

Blink:
The negative value is accepted as animation-delay.
Reading the specified animation gives '0s ease -5s 1 normal none running none'.
Reading computed animation gives '0s ease -5s 1 normal none running none'.

https://jsfiddle.net/ericwilligers/eapsLyub/

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions