[csswg-drafts] [web-animations] Error handling in KeyframeEffect.pseudoElement (#4586)

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

== [web-animations] Error handling in KeyframeEffect.pseudoElement ==
What should KeyframeEffect.pseudoElement do if it is set in an invalid or unsupported value? I can see a few possibilities here.

1. Throw an exception. This can easily break backwards compatibility as the set of pseudo-elements is not currently fixed. Running an animation with a new pseudoelement on an old browser can crash the whole script. I think it makes sense for inputs that don't start with "::" though.

2. Set pseudoElement to null. This fails without crashing but has the disadvantage of causing animations to happen on the wrong element in the case of an unsupported pseudo-element.

3. Leave pseudoElement unchanged. Again, can cause false positives.

4. Set pseudoElement to the text given and do not animate.

5. Set pseudoElement to s sentinel value (such as `::unknown`) which has no effect. Allows for error detection without the possibility of crashes.

My personal preference is for option 5.

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

Received on Wednesday, 11 December 2019 23:00:38 UTC