Skip to content

Commit 07e98f6

Browse files
authored
[web-animations-2] Use dfn type for animation trigger values (#11664)
* [web-animations-2] Use `dfn` type for animation trigger values The values for "animation trigger state" and "animation trigger type" were defined with a `value` definition type. That type is reserved for CSS values: https://speced.github.io/bikeshed/#dfn-types This makes tools that crawl specs to extract machine-readable information wrongly assume that the spec introduces new CSS values. There is no specific definition type available for generic values. This update uses a regular `dfn` and updates references to these values accordingly. * Link animation trigger type values back to dfns in css-animations-2 Per feedback, the values are indeed CSS values for the `animation-trigger-type` property defined in CSS Animations 2. This update replaces the definitions in web-animations-2 by references to the definitions in CSS Animations 2 not to end up with two places that define the values.
1 parent 95b4254 commit 07e98f6

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

web-animations-2/Overview.bs

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2379,40 +2379,40 @@ Issue: Should there be any effect of triggers on scroll-driven animations?
23792379
The behavior an [=animation trigger=] applies to its associated [=animation=]’s
23802380
playback is defined by its <dfn export>animation trigger type</dfn>, and
23812381
depending on its [=animation trigger state|state=] can apply one of two
2382-
distinct behavior types: ''primary'' or ''inverse''.
2382+
distinct behavior types: [=animation trigger state/primary=] or [=animation trigger state/inverse=].
23832383
Given an internal |did trigger| flag, the values of [=animation trigger type=]
23842384
can be one of the following:
23852385

2386-
<dl dfn-type=value dfn-for='animation trigger type'>
2387-
<dt><dfn>once</dfn>
2386+
<dl>
2387+
<dt>''animation-trigger-type/once''
23882388
<dd>
2389-
The ''primary'' behavior is [=play an animation|triggering=] the associated animation.
2389+
The [=animation trigger state/primary=] behavior is [=play an animation|triggering=] the associated animation.
23902390

2391-
<dt><dfn>repeat</dfn>
2391+
<dt>''animation-trigger-type/repeat''
23922392
<dd>
2393-
The ''primary'' behavior is [=play an animation|triggering=] the associated animation.
2394-
The ''inverse'' behavior is resetting the associated [=animation effect=] back to
2393+
The [=animation trigger state/primary=] behavior is [=play an animation|triggering=] the associated animation.
2394+
The [=animation trigger state/inverse=] behavior is resetting the associated [=animation effect=] back to
23952395
its [=animation effect/before phase=] and its associated animation’s [=animation/start time=] to zero.
23962396

2397-
<dt><dfn>alternate</dfn>
2397+
<dt>''animation-trigger-type/alternate''
23982398
<dd>
23992399
<dl class=switch>
24002400
: if the |did trigger| flag is false,
24012401
::
2402-
The ''primary'' behavior is [=play an animation|triggering=] the associated animation.
2402+
The [=animation trigger state/primary=] behavior is [=play an animation|triggering=] the associated animation.
24032403

24042404
: Otherwise,
24052405
::
2406-
The ''primary'' behavior is [=reverse an animation|reversing=] the associated animation.
2406+
The [=animation trigger state/primary=] behavior is [=reverse an animation|reversing=] the associated animation.
24072407

24082408
</dl>
24092409

2410-
The ''inverse'' behavior is [=reverse an animation|reversing=] the associated animation.
2410+
The [=animation trigger state/inverse=] behavior is [=reverse an animation|reversing=] the associated animation.
24112411

2412-
<dt><dfn>state</dfn>
2412+
<dt>''animation-trigger-type/state''
24132413
<dd>
2414-
The ''primary'' behavior is [=play an animation|triggering or resuming=] the associated animation.
2415-
The ''inverse'' behavior is [=pause an animation|pausing=] the associated animation.
2414+
The [=animation trigger state/primary=] behavior is [=play an animation|triggering or resuming=] the associated animation.
2415+
The [=animation trigger state/inverse=] behavior is [=pause an animation|pausing=] the associated animation.
24162416
</dl>
24172417

24182418
Issue: Need to bike-shed the name for type "state" type.
@@ -2427,19 +2427,19 @@ has an internal <dfn export lt="animation trigger state">state</dfn> which
24272427
controls the applied behavior type. This state has discrete values
24282428
which can be one of the following:
24292429

2430-
<dl dfn-for="animation trigger state" dfn-type=value>
2430+
<dl dfn-for="animation trigger state">
24312431
<dt><dfn>idle</dfn>
24322432
<dd>
24332433
The [=animation effect=] associated |animation| remains in
24342434
its [=animation effect/before phase=] and stays at zero [=animation/start time=].
24352435

24362436
<dt><dfn>primary</dfn>
24372437
<dd>
2438-
When switched to this value the ''primary'' behavior type defined by |type| is applied to |animation|.
2438+
When switched to this value the [=animation trigger state/primary=] behavior type defined by |type| is applied to |animation|.
24392439

24402440
<dt><dfn>inverse</dfn>
24412441
<dd>
2442-
When switched to this value the ''inverse'' behavior type defined by |type| is applied to |animation|.
2442+
When switched to this value the [=animation trigger state/inverse=] behavior type defined by |type| is applied to |animation|.
24432443

24442444
</dl>
24452445

@@ -2449,7 +2449,7 @@ Issue: Do we need a formal resolution on the spec of the idle state?
24492449

24502450
Each [=animation trigger=] defines an <dfn for="animation trigger">active interval</dfn>
24512451
and only one such interval. This interval is the segment of the timeline’s progress
2452-
during which the trigger’s [=animation trigger state|state=] is set to ''primary''.
2452+
during which the trigger’s [=animation trigger state|state=] is set to [=animation trigger state/primary=].
24532453

24542454
### Animation Trigger Ranges ### {#trigger-ranges}
24552455

@@ -2464,7 +2464,7 @@ Depending on its most recent [=animation trigger state|state=] |state|, the
24642464
[=animation trigger/active interval|active interval=] is defined as follows:
24652465

24662466
<dl class=switch>
2467-
: If |state| is ''animation trigger state/primary'',
2467+
: If |state| is [=animation trigger state/primary=],
24682468
::
24692469
Then |interval| is set to [=exit range=].
24702470

@@ -2515,7 +2515,7 @@ Depending on its most recent [=animation trigger state|state=] |state|, the
25152515
1. Let |did trigger| be a boolean flag that is initially false.
25162516

25172517
1. Let |state| be the current [=animation trigger state|state=]
2518-
of |trigger| that is initially ''animation trigger state/idle''.
2518+
of |trigger| that is initially [=animation trigger state/idle=].
25192519

25202520
1. Set |state| as follows:
25212521
<dl class=switch>
@@ -2527,7 +2527,7 @@ Depending on its most recent [=animation trigger state|state=] |state|, the
25272527
::
25282528

25292529
<dl class=switch>
2530-
: If |type| is ''animation trigger type/once'' and |did trigger| flag is true,
2530+
: If |type| is 'animation-trigger-type/once'' and |did trigger| flag is true,
25312531
::
25322532
Then abort this procedure.
25332533

@@ -2537,7 +2537,7 @@ Depending on its most recent [=animation trigger state|state=] |state|, the
25372537
<dl class=switch>
25382538
: If |trigger| is inside its [=animation trigger/active interval|active interval=],
25392539
::
2540-
1. Set |state| to ''animation trigger state/primary''.
2540+
1. Set |state| to [=animation trigger state/primary=].
25412541
1. Set |did trigger| to true.
25422542

25432543
: Otherwise,
@@ -2546,7 +2546,7 @@ Depending on its most recent [=animation trigger state|state=] |state|, the
25462546
<dl class=switch>
25472547
: If |did trigger| flag is true,
25482548
::
2549-
Set |state| to ''animation trigger state/inverse''.
2549+
Set |state| to [=animation trigger state/inverse=].
25502550

25512551
</dl>
25522552

@@ -3713,7 +3713,7 @@ dictionary AnimationTriggerOptions {
37133713
: <dfn>type</dfn>
37143714
::
37153715
The type of trigger to create.
3716-
If not specified, the trigger is of type ''animation trigger type/once''.
3716+
If not specified, the trigger is of type ''animation-trigger-type/once''.
37173717

37183718
: <dfn>rangeStart</dfn>
37193719
::
@@ -3748,19 +3748,19 @@ enum AnimationTriggerType { "once", "repeat", "alternate", "state" };
37483748

37493749
: <dfn>once</dfn>
37503750
::
3751-
Type ''animation trigger type/once''.
3751+
Type ''animation-trigger-type/once''.
37523752

37533753
: <dfn>repeat</dfn>
37543754
::
3755-
Type ''animation trigger type/repeat''.
3755+
Type ''animation-trigger-type/repeat''.
37563756

37573757
: <dfn>alternate</dfn>
37583758
::
3759-
Type ''animation trigger type/alternate''.
3759+
Type ''animation-trigger-type/alternate''.
37603760

37613761
: <dfn>state</dfn>
37623762
::
3763-
Type ''animation trigger type/state''.
3763+
Type ''animation-trigger-type/state''.
37643764

37653765
</dl>
37663766

0 commit comments

Comments
 (0)