Skip to content

[web-animations-1] Allow null values for composite? #2074

@birtles

Description

@birtles

From @birtles on October 18, 2017 7:18

#148 has now been merged which allows specifying arrays of offsets. As part of this we had to continue allowing null values for compatibility reasons. On the positive side, however, you can now do this sort of thing:

elem.animate({ color: [ 'blue', 'green', 'red', 'yellow', 'pink' ],
               offset: [ null, 0.5, null, 0.8 ] }, 2000);

i.e. you can use null to represent holes that the UA fills in using its auto-spacing behavior.

Now, for composite modes, not specifying a value means "use the composite operation specified at the base level, i.e. on the keyframe effect". Being able to use null for this might be useful. For example, if you only wanted to override every second value, you could do:

elem.animate({ color: [ 'blue', 'green', 'red', 'yellow', 'pink' ],
               composite: [ null, 'add' ] }, 2000);

Maybe that's not very common, but at least it would be more consistent?

Copied from original issue: w3c/web-animations#203

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