Skip to content

Commit cf3a00e

Browse files
authored
[web-animations-1] Add parameter for fetching all animations on a subtree (w3c#3902)
This fixes w3c#2058.
1 parent fc5c130 commit cf3a00e

File tree

1 file changed

+34
-4
lines changed

1 file changed

+34
-4
lines changed

web-animations-1/Overview.bs

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5717,11 +5717,16 @@ the {{Animatable}} interface mixin.
57175717
interface mixin Animatable {
57185718
Animation animate (object? keyframes,
57195719
optional (unrestricted double or KeyframeAnimationOptions) options);
5720-
sequence<Animation> getAnimations ();
5720+
sequence<Animation> getAnimations (optional GetAnimationsOptions options);
57215721
};
5722+
57225723
dictionary KeyframeAnimationOptions : KeyframeEffectOptions {
57235724
DOMString id = "";
57245725
};
5726+
5727+
dictionary GetAnimationsOptions {
5728+
boolean subtree = false;
5729+
};
57255730
</pre>
57265731

57275732
<div class="methods">
@@ -5790,11 +5795,14 @@ animation.play();</pre>
57905795

57915796
</div>
57925797

5793-
: <dfn method for=Animatable lt="getAnimations()">
5794-
sequence&lt;Animation&gt; getAnimations()</dfn>
5798+
: <dfn method for=Animatable lt="getAnimations(options)">
5799+
sequence&lt;Animation&gt; getAnimations(options)</dfn>
57955800
:: Returns the set of [=relevant=] {{Animation}} objects
57965801
that contain at least one <a>animation effect</a> whose
5797-
<a>target element</a> is this object.
5802+
<a>target element</a> is this object, or,
5803+
if an {{Animatable/getAnimations(options)/options}} parameter
5804+
is passed with {{GetAnimationsOptions/subtree}} set to true,
5805+
an [=inclusive descendant=] of this object.
57985806

57995807
An [=animation=] is
58005808
<dfn lt="relevant animation" local-lt="relevant">relevant</dfn> if:
@@ -5803,6 +5811,10 @@ animation.play();</pre>
58035811
<em>and</em>
58045812
* Its [=replace state=] is <em>not</em> [=removed replace state|removed=].
58055813

5814+
For the purposes of this method
5815+
a [=pseudo-element=] is considered to be
5816+
a [=child=] of its [=originating element=].
5817+
58065818
The returned list is sorted using the composite order described
58075819
for the associated <a>animations</a> of effects in [[#the-effect-stack]].
58085820

@@ -5812,6 +5824,15 @@ animation.play();</pre>
58125824
any pending style changes to animation such as changes to animation-related
58135825
style properties that have yet to be processed.
58145826

5827+
<div class="parameters">
5828+
5829+
: <dfn argument for="Animatable/getAnimations(options)"
5830+
lt="options">options</dfn>
5831+
:: Parameters governing the set of animations returned by
5832+
{{Animatable/getAnimations()}}.
5833+
5834+
</div>
5835+
58155836
</div>
58165837

58175838
<div class="members">
@@ -5820,6 +5841,12 @@ animation.play();</pre>
58205841
:: The string to assign to the generated {{Animation}}'s {{Animation/id}}
58215842
attribute.
58225843

5844+
: <dfn dict-member for=GetAnimationsOptions>subtree</dfn>
5845+
:: If true, indicates that [=animations=] associated with an
5846+
[=animation effect=] whose [=target element=] is a [=descendant=]
5847+
of the object on which {{Animatable/getAnimations()}} is called should also
5848+
be included in the result.
5849+
58235850
</div>
58245851

58255852
<h3 id="extensions-to-the-document-interface">Extensions to the <code>Document</code> interface</h3>
@@ -6189,6 +6216,9 @@ The following changes have been made since the <a
61896216
{{Animation/persist}}.
61906217
* Added the {{Animation/commitStyles}} method to the {{Animation}} interface
61916218
to allow preserving the result of an [=animation=] that has been removed.
6219+
* Added an {{Animatable/getAnimations(options)/options}} parameter to the
6220+
{{Animatable/getAnimations()}} method on the {{Animatable}} interface
6221+
to allow fetching all animations on descendants of a particular element.
61926222

61936223
The <a
61946224
href="https://github.com/w3c/csswg-drafts/commits/master/web-animations-1">changelog</a>

0 commit comments

Comments
 (0)