Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 67 additions & 25 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1534,6 +1534,19 @@ <h2>
playing.
</td>
</tr>
<tr>
<td>
<dfn data-dfn-for="GamepadHapticActuator">[[\sequenceId]]</dfn>
</td>
<td>
0
</td>
<td>
An {{unsigned long}} incremented for each call to
{{GamepadHapticActuator/playEffect}} or
{{GamepadHapticActuator/reset}}.
</td>
</tr>
</table>
<dl data-dfn-for="GamepadHapticActuator">
<dt>
Expand Down Expand Up @@ -1577,6 +1590,8 @@ <h2>
`"hidden"`, return [=a promise rejected with=] an
"{{InvalidStateError}}" {{DOMException}}.
</li>
<li>Increment [=this=].{{GamepadHapticActuator/[[sequenceId]]}}.
</li>
<li>If [=this=].{{GamepadHapticActuator/[[playingEffectPromise]]}}
is not `null`:
<ol>
Expand All @@ -1597,8 +1612,15 @@ <h2>
type=] |type|, return [=a promise rejected with=] reason
{{NotSupportedError}}.
</li>
<li>Let {{GamepadHapticActuator/[[playingEffectPromise]]}} be [=a
new promise=].
<li>[=Assert=]
[=this=].{{GamepadHapticActuator/[[playingEffectPromise]]}} is
`null`.
</li>
<li>Let [=this=].{{GamepadHapticActuator/[[playingEffectPromise]]}}
Comment thread
nondebug marked this conversation as resolved.
be [=a new promise=].
</li>
<li>Let |effectSequenceId:unsigned long| be
[=this=].{{GamepadHapticActuator/[[sequenceId]]}}.
</li>
<li>Let |playEffectTimestamp:DOMHighResTimestamp| be the [=current
high resolution time=] given the |document|'s [=relevant global
Expand All @@ -1609,15 +1631,12 @@ <h2>
<li>[=Issue a haptic effect=] to the actuator with |type|,
|params|, and the |playEffectTimestamp|.
</li>
<li>When the effect completes, if
[=this=].{{GamepadHapticActuator/[[playingEffectPromise]]}} is
not `null`, [=queue a global task=] on the [=relevant global
object=] of [=this=] using the [=gamepad task source=] to run
the following steps:
<li>When the effect completes, [=queue a global task=] on the
[=relevant global object=] of [=this=] using the [=gamepad task
source=] to run the following steps:
<ol>
<li>If
[=this=].{{GamepadHapticActuator/[[playingEffectPromise]]}}
is `null`, abort these steps.
<li>If [=this=].{{GamepadHapticActuator/[[sequenceId]]}} is
Comment thread
nondebug marked this conversation as resolved.
not |effectSequenceId|, abort these steps.
</li>
<li>[=Resolve=]
[=this=].{{GamepadHapticActuator/[[playingEffectPromise]]}}
Expand All @@ -1631,7 +1650,8 @@ <h2>
</li>
</ol>
</li>
<li>Return {{GamepadHapticActuator/[[playingEffectPromise]]}}.
<li>Return
[=this=].{{GamepadHapticActuator/[[playingEffectPromise]]}}.
</li>
</ol>
</dd>
Expand All @@ -1651,37 +1671,59 @@ <h2>
`"hidden"`, return [=a promise rejected with=] an
"{{InvalidStateError}}" {{DOMException}}.
</li>
<li>Let |resetResultPromise:Promise| be [=a new promise=].
<li>Increment [=this=].{{GamepadHapticActuator/[[sequenceId]]}}.
</li>
<li>If [=this=].{{GamepadHapticActuator/[[playingEffectPromise]]}}
is not `null`, do the following steps [=in parallel=]:
is not `null`:
<ol>
<li>Let |effectPromise| be
[=this=].{{GamepadHapticActuator/[[playingEffectPromise]]}}.
</li>
<li>Set
[=this=].{{GamepadHapticActuator/[[playingEffectPromise]]}} to
`null`.
</li>
<li>[=Queue a global task=] on the [=relevant global object=]
of [=this=] using the [=gamepad task source=] to [=resolve=]
|effectPromise| with {{GamepadHapticsResult/"preempted"}}.
</li>
</ol>
</li>
<li>[=Assert=]
[=this=].{{GamepadHapticActuator/[[playingEffectPromise]]}} is
`null`.
</li>
<li>Let [=this=].{{GamepadHapticActuator/[[playingEffectPromise]]}}
Comment thread
nondebug marked this conversation as resolved.
be [=a new promise=].
</li>
<li>Let |resetSequenceId:unsigned long| be
[=this=].{{GamepadHapticActuator/[[sequenceId]]}}.
</li>
<li>Do the following steps [=in parallel=]:
<ol>
<li>[=Stop haptic effects=] on [=this=]'s gamepad's actuator.
</li>
<li>If the effect has been successfully stopped, do:
<li>If the effect has been successfully stopped, [=queue a
global task=] on the [=relevant global object=] of [=this=]
using the [=gamepad task source=] to run the following steps:
<ol>
<li>If |effectPromise| and
<li>If [=this=].{{GamepadHapticActuator/[[sequenceId]]}} is
not |resetSequenceId|, abort these steps.
</li>
<li>[=Resolve=]
[=this=].{{GamepadHapticActuator/[[playingEffectPromise]]}}
are still the same, set
with {{GamepadHapticsResult/"complete"}}.
</li>
<li>Set
[=this=].{{GamepadHapticActuator/[[playingEffectPromise]]}}
to `null`.
</li>
<li>[=Queue a global task=] on the [=relevant global
object=] of [=this=] using the [=gamepad task source=] to
[=resolve=] |effectPromise| with
{{GamepadHapticsResult/"preempted"}}.
</li>
</ol>
</li>
<li>[=Resolve=] |resetResultPromise| with
{{GamepadHapticsResult/"complete"}}
</li>
</ol>
</li>
<li>Return |resetResultPromise|.
<li>Return
[=this=].{{GamepadHapticActuator/[[playingEffectPromise]]}}.
</li>
</ol>
</dd>
Expand Down