[csswg-drafts] [web-animations-1] CSS parsing context for the procedure to process a keyframes argument ?

stephenmcgruer has just created a new issue for https://github.com/w3c/csswg-drafts:

== [web-animations-1] CSS parsing context for the procedure to process a keyframes argument ? ==
Spec link: https://drafts.csswg.org/web-animations-1/#process-a-keyframes-argument

Step 8.1 of the "procedure to process a keyframes argument" says:

> For each property-value pair in frame, parse the property value using the syntax specified for that property.
> 
> If the property value is invalid according to the syntax for the property, discard the property-value pair. User agents that provide support for diagnosing errors in content SHOULD produce an appropriate warning highlighting the invalid property value.

My understanding is that to parse a CSS property value and check whether it is syntactically correct requires an associated Document or similar context for the parsing. For example, it will likely be possible in the near future for web-developers to define custom syntaxes for CSS values - https://drafts.css-houdini.org/css-properties-values-api/#registering-custom-properties

This raises two related issues with the spec as is today:

1. What Document/context should be used for step 8.1 of the "procedure to process a keyframes argument", especially if the |target| is null?
  i. Note that the later procedure to produce computed keyframes specifies this clearly, in that the target (which has to be non-null in that procedure) is used as the context.

2. What should the user-agent do if the "procedure to process a keyframes argument" is called in a context where (say), "foo: bar" is a valid CSS property/value pair, **but** the target is then changed to a context where "foo: bar" is **not** a valid CSS property/value pair?
  i. The procedure to produce computed keyframes assumes that the CSS property/value pair are syntactically valid for the current target.

3. Same as the previous point, but for the reverse scenario - a property/value pair which is dropped when processing the keyframes argument but would be valid for the later target. This is less of an issue as you just end up dropping the pair when processing the keyframes argument and that's probably ok.


Thoughts? :D

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2366 using your GitHub account

Received on Tuesday, 27 February 2018 16:03:53 UTC