W3C home > Mailing lists > Public > public-css-archive@w3.org > December 2017

Re: [csswg-drafts] [web-animations-1] Default timeline parameter in Animation constructor is confusing

From: Boris Zbarsky via GitHub <sysbot+gh@w3.org>
Date: Tue, 19 Dec 2017 17:45:25 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-352833722-1513705523-sysbot+gh@w3.org>
> I find that calling `new Animation(new KeyframeEffect(…))` and `new Animation(new KeyframeEffect(…), undefined)` and having the first one set timeline to document.timeline and the other to undefined is not intuitive to a JS developer

Those two constructor calls have identical behavior, per WebIDL.  In both cases, the optional argument is missing.  The old spec text used to say "not provided", which doesn't have a defined meaning, but had it said "missing" the behavior would be clearly specified to use the document timeline in both cases.

Specifically, see https://heycam.github.io/webidl/#es-overloads step 14 substep 4 subsubstep 2 (what happens if you pass `undefined` explicitly) and compare to step 15 substep 2 (what happens if you don't pas anything).

GitHub Notification of comment by bzbarsky
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2078#issuecomment-352833722 using your GitHub account
Received on Tuesday, 19 December 2017 17:45:29 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:21 UTC