Re: [csswg-drafts] [web-animations-1] Fix invalid error code for KeyfameEffect.pseudoElement (#4829)

> There's definitely a case for a JS TypeError. Are there any other examples of it being used for an invalid value outside an infinite family of strings (SyntaxError seems to be used here a lot), or just for values outside finite enums? `pseudoElement` can take any syntactically valid pseudo-element selector (such as `::foo`) whether the selector is supported or not.

One example is that in the [process a keyframes argument procedure](https://drafts.csswg.org/web-animations-1/#process-a-keyframes-argument) right towards the end we have:

> If parsing the “easing” property fails, throw a TypeError and abort this procedure.

So at least within Web Animations, we currently always use a TypeError. I don't recall exactly how we ended up there. There was certainly at least one case where we were deciding between SyntaxError or TypeError and the advice we got was something along the lines of, "We normally use TypeError, but it doesn't really matter". Maybe @heycam recalls?

-- 
GitHub Notification of comment by birtles
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/pull/4829#issuecomment-594934041 using your GitHub account

Received on Wednesday, 4 March 2020 23:33:24 UTC