Skip to content

Commit 6301a49

Browse files
authored
Fix wrong syntax around firing events in the spec (#2592)
* initial commit * addressing comments
1 parent 116612c commit 6301a49

File tree

1 file changed

+36
-44
lines changed

1 file changed

+36
-44
lines changed

index.bs

Lines changed: 36 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2018,9 +2018,9 @@ Constructors</h4>
20182018
1. If |document| is not allowed to use the feature identified by
20192019
<code>"speaker-selection"</code>, abort these substeps.
20202020

2021-
1. [=queue a media element task=] to [=fire an event=] using {{ErrorEvent}}
2022-
at the {{AudioContext/error}} of the {{AudioContext}}, and abort the
2023-
following steps.
2021+
1. [=Queue a media element task=] to [=fire an event=] named
2022+
{{AudioContext/error}} at the {{AudioContext}}, and abort the following
2023+
steps.
20242024

20252025
1. Set [=this=] {{[[rendering thread state]]}} to <code>running</code> on the
20262026
{{AudioContext}}.
@@ -2475,9 +2475,8 @@ Methods</h4>
24752475

24762476
1. Set the {{BaseAudioContext/state}} attribute of the {{AudioContext}} to "{{AudioContextState/running}}".
24772477

2478-
1. <a href="https://html.spec.whatwg.org/multipage/media.html#queue-a-media-element-task">
2479-
queue a media element task</a> to <a spec="dom" lt="fire an event">fire
2480-
an event </a> named {{BaseAudioContext/statechange}} at the {{AudioContext}}.
2478+
1. [=Queue a media element task=] to [=fire an event=] named
2479+
{{BaseAudioContext/statechange}} at the {{AudioContext}}.
24812480
</div>
24822481

24832482
<div>
@@ -2546,9 +2545,8 @@ Methods</h4>
25462545

25472546
1. Set the {{BaseAudioContext/state}} attribute of the {{AudioContext}} to "{{AudioContextState/suspended}}".
25482547

2549-
1. <a href="https://html.spec.whatwg.org/multipage/media.html#queue-a-media-element-task">
2550-
queue a media element task</a> to <a spec="dom" lt="fire an event">fire
2551-
an event </a> named {{BaseAudioContext/statechange}} at the {{AudioContext}}.
2548+
1. [=Queue a media element task=] to [=fire an event=] named
2549+
{{BaseAudioContext/statechange}} at the {{AudioContext}}.
25522550
</div>
25532551

25542552
While an {{AudioContext}} is suspended,
@@ -2648,9 +2646,9 @@ Methods</h4>
26482646

26492647
1. Set the {{BaseAudioContext/state}} attribute of the
26502648
{{AudioContext}} to "{{AudioContextState/suspended}}".
2651-
2652-
1. <a spec="dom" lt="fire an event">Fire an event</a> named
2653-
{{BaseAudioContext/statechange}} at the associated {{AudioContext}}.
2649+
2650+
1. [=Fire an event=] named {{BaseAudioContext/statechange}} at the
2651+
associated {{AudioContext}}.
26542652

26552653
1. Attempt to <a href="#acquiring">acquire system resources</a> to use
26562654
a following audio output device based on {{AudioContext/[[sink ID]]}}
@@ -2681,8 +2679,8 @@ Methods</h4>
26812679

26822680
1. Resolve |p|.
26832681

2684-
1. <a spec="dom" lt="fire an event">Fire an event</a> named
2685-
{{AudioContext/sinkchange}} at the associated {{AudioContext}}.
2682+
1. [=Fire an event=] named {{AudioContext/sinkchange}} at the
2683+
associated {{AudioContext}}.
26862684

26872685
1. If |wasRunning| is true:
26882686

@@ -2698,8 +2696,8 @@ Methods</h4>
26982696
1. Set the {{BaseAudioContext/state}} attribute of the
26992697
{{AudioContext}} to "{{AudioContextState/running}}".
27002698

2701-
1. <a spec="dom" lt="fire an event">Fire an event</a> named
2702-
{{BaseAudioContext/statechange}} at the associated {{AudioContext}}.
2699+
1. [=Fire an event=] named {{BaseAudioContext/statechange}} at the
2700+
associated {{AudioContext}}.
27032701
</div>
27042702

27052703
</ins>
@@ -2956,9 +2954,8 @@ Dictionary {{AudioTimestamp}} Members</h5>
29562954
<dl dfn-type=method dfn-for="AudioRenderCapacity">
29572955
: <dfn>start(options)</dfn>
29582956
::
2959-
Starts metric collection and analysis. This will repeatedly
2960-
<a spec="dom" lt="fire an event">fire an event</a> named
2961-
{{AudioRenderCapacity/update}} at {{AudioRenderCapacity}}, using
2957+
Starts metric collection and analysis. This will repeatedly [=fire an event=] named
2958+
{{AudioRenderCapacity/update}} at the {{AudioRenderCapacity}}, using
29622959
{{AudioRenderCapacityEvent}}, with the given update interval in
29632960
{{AudioRenderCapacityOptions}}.
29642961

@@ -3297,14 +3294,13 @@ Methods</h4>
32973294
queue a media element task</a> to execute the following steps:
32983295

32993296
<ol>
3300-
<li>Resolve the <var ignore>promise</var> created by {{startRendering()}} with {{[[rendered buffer]]}}.
3297+
<li>Resolve the <var ignore>promise</var> created by {{startRendering()}}
3298+
with {{[[rendered buffer]]}}.
33013299

3302-
<li><a href="https://html.spec.whatwg.org/multipage/media.html#queue-a-media-element-task">
3303-
queue a media element task</a> to
3304-
<a spec="dom" lt="fire an event">fire an event</a> named
3305-
{{OfflineAudioContext/complete}} using an instance of {{OfflineAudioCompletionEvent}}
3306-
whose `renderedBuffer` property is set to
3307-
{{[[rendered buffer]]}}.
3300+
<li>[=Queue a media element task=] to [=fire an event=] named
3301+
{{OfflineAudioContext/complete}} at the {{OfflineAudioContext}} using
3302+
{{OfflineAudioCompletionEvent}} whose `renderedBuffer` property is set to
3303+
{{[[rendered buffer]]}}.
33083304

33093305
</ol>
33103306

@@ -3373,9 +3369,8 @@ Methods</h4>
33733369
1. Set the {{BaseAudioContext/state}} attribute of the
33743370
{{OfflineAudioContext}} to "{{AudioContextState/running}}".
33753371

3376-
1. <a href="https://html.spec.whatwg.org/multipage/media.html#queue-a-media-element-task">
3377-
queue a media element task</a> to <a spec="dom" lt="fire an event">fire
3378-
an event</a> named {{BaseAudioContext/statechange}} at the {{OfflineAudioContext}}.
3372+
1. [=Queue a media element task=] to [=fire an event=] named
3373+
{{BaseAudioContext/statechange}} at the {{OfflineAudioContext}}.
33793374

33803375
</div>
33813376

@@ -11512,10 +11507,10 @@ the <a>rendering thread</a> will invoke the algorithm below:
1151211507
of this {{AudioWorkletGlobalScope}}'s
1151311508
[=pending processor construction data=] respectively.
1151411509

11515-
1. <a spec=webidl lt=construct>Construct a callback function</a> from |processorCtor| with the argument
11516-
of |deserializedOptions|. If any exceptions are thrown in the callback, <a>queue a task</a> to
11517-
the <a>control thread</a> to <a spec="dom" lt="fire an event">fire an event</a> named
11518-
{{AudioWorkletNode/processorerror}} using {{ErrorEvent}} at |nodeReference|.
11510+
1. <a spec=webidl lt=construct>Construct a callback function</a> from |processorCtor| with
11511+
the argument of |deserializedOptions|. If any exceptions are thrown in the callback,
11512+
<a>queue a task</a> to the <a>control thread</a> to [=fire an event=] named
11513+
{{AudioWorkletNode/processorerror}} at |nodeReference| using {{ErrorEvent}}.
1151911514

1152011515
1. Empty the [=pending processor construction data=] slot.
1152111516
</div>
@@ -11699,10 +11694,8 @@ Attributes</h5>
1169911694
When an unhandled exception is thrown from the processor's
1170011695
<code>constructor</code>, <code>process</code> method,
1170111696
or any user-defined class method, the processor will
11702-
<a href="https://html.spec.whatwg.org/multipage/media.html#queue-a-media-element-task"> queue a media
11703-
element task</a> to <a spec="dom" lt="fire an event">fire an event</a> named <dfn event>processorerror</dfn> using
11704-
<a href="https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface">
11705-
ErrorEvent</a> at the associated {{AudioWorkletNode}}.
11697+
[=queue a media element task=] to [=fire an event=] named <dfn event>processorerror</dfn>
11698+
at the associated {{AudioWorkletNode}} using {{ErrorEvent}}.
1170611699

1170711700
The <code>ErrorEvent</code> is created and initialized
1170811701
appropriately with its <code>message</code>,
@@ -12862,10 +12855,9 @@ task queue=] of its associated {{BaseAudioContext}}.
1286212855

1286312856
1. [=Making a buffer available for reading|Make a silent output buffer available for reading=].
1286412857

12865-
1. <a>Queue a task</a> to the <a>control thread</a>
12866-
<a spec="dom" lt="fire an event">fire</a> an
12867-
{{ErrorEvent}} named {{AudioWorkletNode/processorerror}} at the
12868-
associated {{AudioWorkletNode}}.
12858+
1. <a>Queue a task</a> to the <a>control thread</a> to [=fire an event=]
12859+
named {{AudioWorkletNode/processorerror}} at the associated
12860+
{{AudioWorkletNode}} using {{ErrorEvent}}.
1286912861

1287012862
5. If this {{AudioNode}} is a <a>destination node</a>,
1287112863
[=Recording the input|record the input=] of this {{AudioNode}}.
@@ -12949,7 +12941,7 @@ The {{AudioContext}} |audioContext| performs the following steps on <a>rendering
1294912941

1295012942
1. [=Queue a media element task=] to execute the following steps:
1295112943

12952-
1. [=Fire an event=] using {{ErrorEvent}} at the |audioContext|'s {{AudioContext/error}}.
12944+
1. [=Fire an event=] named {{AudioContext/error}} at |audioContext| using {{ErrorEvent}}.
1295312945

1295412946
1. Set the |audioContext|'s {{[[suspended by user]]}} to <code>false</code>.
1295512947

@@ -12958,15 +12950,15 @@ The {{AudioContext}} |audioContext| performs the following steps on <a>rendering
1295812950
1. Set the |audioContext|'s {{BaseAudioContext/state}} attribute to
1295912951
"{{AudioContextState/suspended}}".
1296012952

12961-
1. [=Fire an event=] at the |audioContext|'s {{BaseAudioContext/statechange}}.
12953+
1. [=Fire an event=] named {{BaseAudioContext/statechange}} at the |audioContext|.
1296212954

1296312955
1. Abort these steps.
1296412956

1296512957
1. If the |audioContext|'s {{[[rendering thread state]]}} is <code>suspended</code>:
1296612958

1296712959
1. [=Queue a media element task=]to execute the following steps:
1296812960

12969-
1. [=Fire an event=] using {{ErrorEvent}} at the |audioContext|'s {{AudioContext/error}}.
12961+
1. [=Fire an event=] named {{AudioContext/error}} at |audioContext| using {{ErrorEvent}}.
1297012962

1297112963
Note: An example of system audio resource errors would be when an external or wireless audio device
1297212964
becoming disconnected during the active rendering of the {{AudioContext}}.

0 commit comments

Comments
 (0)