[web-animations] Confusing variable names in Animatable.animate() examples

Hi all,

Animatable.animate()
(http://w3c.github.io/web-animations/#the-animatable-interface) contains
the following examples:

EXAMPLE 15
var anim = elem.animate({ opacity: 0 }, 2000);

is equivalent to:

EXAMPLE 16
var anim = new Animation(elem, { opacity: 0 }, 2000);
elem.ownerDocument.timeline.play(anim);

In these examples variable anim is used for AnimationPlayer in Example 15
and for Animation in Example 16. This may be confusing. It's better to
rewrite these examples in the following way:

EXAMPLE 15
var player = elem.animate({ opacity: 0 }, 2000);

is equivalent to:

EXAMPLE 16
var anim = new Animation(elem, { opacity: 0 }, 2000);
var player = elem.ownerDocument.timeline.play(anim);

Thank you,
Sergey G. Grekhov

Received on Thursday, 5 March 2015 06:38:48 UTC