From 2ebac2f5fea53bb2094018fb11699583e3596851 Mon Sep 17 00:00:00 2001 From: Majid Valipour Date: Thu, 30 Apr 2020 16:08:42 -0400 Subject: [PATCH 1/2] [web-animations-1] Add timeline to animate options (#5013) --- web-animations-1/Overview.bs | 39 +++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/web-animations-1/Overview.bs b/web-animations-1/Overview.bs index 71008ef3f19..c81eb8605ee 100644 --- a/web-animations-1/Overview.bs +++ b/web-animations-1/Overview.bs @@ -5789,6 +5789,7 @@ interface mixin Animatable { dictionary KeyframeAnimationOptions : KeyframeEffectOptions { DOMString id = ""; + AnimationTimeline? timeline; }; dictionary GetAnimationsOptions { @@ -5821,9 +5822,22 @@ dictionary GetAnimationsOptions { of the element on which this method was called as the timeline argument. - 1. If options is a {{KeyframeAnimationOptions}} object, - assign the value of the id member of options to - animation's {{Animation/id}} attribute. + 1. If options is a {{KeyframeAnimationOptions}} object, run the + following steps: + + 1. Assign the value of the id member of options + to animation's {{Animation/id}} attribute. + + 2. Let timeline be the timeline member of + options or, if timeline member of + options is missing, be the + default document timeline of the {{Document}} + associated with the + {{Window}} that is the current global object. + + 3. Run the procedure to set the timeline of an animation on + animation passing timeline as the new + timeline. 1. Run the procedure to play an animation for animation with the auto-rewind flag set to true. @@ -5856,10 +5870,14 @@ animation.play(); same interpretation as defined for that constructor. : options - :: The timing and animation options for the created {{KeyframeEffect}}. - This value is passed to the {{KeyframeEffect(target, keyframes, - options)}} constructor as the options parameter and has the - same interpretation as defined for that constructor. + :: The timing and animation options for the created {{KeyframeEffect}} and + {{Animation}}. + For {{KeyframeEffect}} this value is passed to the + {{KeyframeEffect(target, keyframes, options)}} constructor as the + options parameter and has the same interpretation as defined + for that constructor. For {{Animation}}, id and + timeline member gets assigned to the created + {{Animation}}'s {{Animation/id}} and {{Animation/timeline}} attributes. @@ -5910,6 +5928,13 @@ animation.play(); :: The string to assign to the generated {{Animation}}'s {{Animation/id}} attribute. +: timeline +:: An optional value which, if present, specifies the timeline + with which to associate the newly-created animation. + If missing, the default document timeline of the + {{Document}} associated + with the {{Window}} that is the current global object is used. + : subtree :: If true, indicates that [=animations=] associated with an [=animation effect=] whose [=target element=] is a [=descendant=] From d1179543665b223ac6e8abf5ed91050ac46faa1c Mon Sep 17 00:00:00 2001 From: Majid Valipour Date: Thu, 7 May 2020 16:00:39 -0400 Subject: [PATCH 2/2] [scroll-animations-1] Addres bbirtles@ feedback (#5013) --- web-animations-1/Overview.bs | 37 +++++++++++------------------------- 1 file changed, 11 insertions(+), 26 deletions(-) diff --git a/web-animations-1/Overview.bs b/web-animations-1/Overview.bs index c81eb8605ee..9368e625cdc 100644 --- a/web-animations-1/Overview.bs +++ b/web-animations-1/Overview.bs @@ -5814,30 +5814,21 @@ dictionary GetAnimationsOptions { If the above procedure causes an exception to be thrown, propagate the exception and abort this procedure. + 1. If options is a {{KeyframeAnimationOptions}} object, let + timeline be the timeline member of + options or, if timeline member of + options is missing, be the default document timeline + of the node document of the element on which this method was + called. + 1. Construct a new {{Animation}} object, animation, in the relevant Realm of target by using the same procedure as the {{Animation()}} constructor, passing - effect as the argument of the same name, and - the default document timeline of the node document - of the element on which this method was called as the - timeline argument. - - 1. If options is a {{KeyframeAnimationOptions}} object, run the - following steps: - - 1. Assign the value of the id member of options - to animation's {{Animation/id}} attribute. - - 2. Let timeline be the timeline member of - options or, if timeline member of - options is missing, be the - default document timeline of the {{Document}} - associated with the - {{Window}} that is the current global object. + effect and timeline as arguments of the same name. - 3. Run the procedure to set the timeline of an animation on - animation passing timeline as the new - timeline. + 1. If options is a {{KeyframeAnimationOptions}} object, + assign the value of the id member of options + to animation's {{Animation/id}} attribute. 1. Run the procedure to play an animation for animation with the auto-rewind flag set to true. @@ -5872,12 +5863,6 @@ animation.play(); lt="options">options :: The timing and animation options for the created {{KeyframeEffect}} and {{Animation}}. - For {{KeyframeEffect}} this value is passed to the - {{KeyframeEffect(target, keyframes, options)}} constructor as the - options parameter and has the same interpretation as defined - for that constructor. For {{Animation}}, id and - timeline member gets assigned to the created - {{Animation}}'s {{Animation/id}} and {{Animation/timeline}} attributes.