Skip to content

[web-animations-1] Web animations should read prefixed/aliased properties too #3948

Open
@birtles

Description

@birtles

Background: Mozilla bug 1551818

In Firefox 68 and prior it was possible to animate -moz-user-select using { MozUserSelect: ['text', 'none'] } but that stopped working recently since we made -moz-user-select an alias of user-select and we ignore aliases when reading keyframes.

Web Animations doesn't specifically say not to read aliases or prefixed properties on keyframes but that was the intention in the past and in my testing neither Chrome nor Safari read Webkit... prefixes.

I believe Shane was of the view that we shouldn't support prefixed properties because they are on the way out. Since then, however, we've specified a number of these properties in the compatibility spec and elsewhere and some properties still don't have un-prefixed equivalents. Furthermore, when exposing CSS animations / transitions that use these properties we have to return something and whatever we return from getKeyframes() should be able to be round-tripped using setKeyframes().

(The round-tripping for CSS animations/transitions works in Gecko simply because we resolve aliases when parsing the @keyframes / transitions so while we might return a prefixed property from getKeyframes() we'll never return an alias. Furthermore, our implementation of setKeyframes() allows prefixed properties, just not aliases.)

I suggest Web Animations should accept prefixed properties (to support properties which don't yet have an unprefixed version) and should accept aliased properties (so that content using the prefixed version continues to work once it is un-prefixed).

When an aliased property is specified along with the property it reflects, the property it reflects should win (i.e. transform trumps MozTransform). This would be resolved in the procedure to calculate computed keyframes, i.e. the same place we specify that longhands override shorthands, physical overrides logical etc.

When multiple aliases are specified (e.g. WebkitTransform and MozTransform) without the property they refer to (i.e. transform) then we would just use the same procedure as for overlapping shorthands -- sort by unicode codepoints of the property IDL names.

Thoughts?

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