w3c / w3c/csswg-drafts

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

Open
#3,948 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

web-animations-1
Dominant language
Bikeshed
Stars
4.9k
Forks
816
PR merge metrics
PR metrics pending

Description

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?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Web Animations Level 1 computed keyframes procedure and the getKeyframes()/setKeyframes() behavior described in the issue. Review Mozilla bug 1551818 and the compatibility spec, then work out the spec resolution for prefixed and aliased properties, including precedence and round-tripping; done means the relevant algorithms and their expected behavior are agreed and updated.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, javascript
Domain
frontend, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.