W3C home > Mailing lists > Public > public-css-archive@w3.org > March 2020

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

From: Brian Birtles via GitHub <sysbot+gh@w3.org>
Date: Wed, 04 Mar 2020 23:33:23 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-594934041-1583364801-sysbot+gh@w3.org>
> 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

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:02 UTC