Bug 212161 - iterationCount in Web Animations JavaScript API doesn't do anything
Summary: iterationCount in Web Animations JavaScript API doesn't do anything
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Animations (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-05-20 12:51 PDT by Jack Wellborn
Modified: 2020-05-22 03:07 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jack Wellborn 2020-05-20 12:51:53 PDT
Hello again,

E
Comment 1 Jack Wellborn 2020-05-20 12:57:14 PDT
Reading this article https://webkit.org/blog/10266/web-animations-in-safari-13-1/, I tried the last sample under "Part I – Animation Creation" in the console by selecting an element and using $0.animate.... Everything in the example worked as expected except iterationCount. The animation plays once regardless of the value.

Expected Behavior:
Animation repeats to the value provided in iterationCount.

Actual Behavior:
Animation only plays once regardless of the value provided in iterationCount.

Let me know if a test page would help.
Comment 2 Jack Wellborn 2020-05-20 14:51:23 PDT
Here's a test page. 
http://jackwellborn.com/playground/iterationCountTest/index.html
Comment 3 Radar WebKit Bug Importer 2020-05-20 16:37:02 PDT
<rdar://problem/63469000>
Comment 4 Antoine Quint 2020-05-21 06:31:04 PDT
Thanks for filing this Jack. This was a mistake in the blog post! The property is "iterations", not "iterationCount". Here's the relevant IDL in the Web Animations spec: https://drafts.csswg.org/web-animations-1/#dictdef-effecttiming. We'll fix the blog post.

I also noticed the spec has a non-normative mention of "iterationCount" that I'll fix in https://github.com/w3c/csswg-drafts/issues/5096.
Comment 5 Jack Wellborn 2020-05-21 07:56:29 PDT
Thanks.

I see it working with 'iterations'. I think the confusion is that the css property is 'animation-iteration-count' (https://www.w3.org/TR/css-animations-1/#animation-iteration-count) and that JavaScript property names typically reflect css property names. In that sense, I kind of feel like the JavaScript name is non-normative. Just out of my own curiosity, in what sense is 'iterationCount' non-normative?
Comment 6 Antoine Quint 2020-05-22 03:07:49 PDT
(In reply to Jack Wellborn from comment #5)
> Thanks.
> 
> I see it working with 'iterations'. I think the confusion is that the css
> property is 'animation-iteration-count'
> (https://www.w3.org/TR/css-animations-1/#animation-iteration-count) and that
> JavaScript property names typically reflect css property names. In that
> sense, I kind of feel like the JavaScript name is non-normative. Just out of
> my own curiosity, in what sense is 'iterationCount' non-normative?

It was used in some example text in the spec, and it's now gone completely in the spec's Git repository. It was just a mistake, the `iterationCount` property does not exist :)