Skip to content
Merged
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
22 changes: 18 additions & 4 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1105,9 +1105,11 @@ Methods</h4>
called, the following steps MUST be performed on the control
thread:</span>

1. Let <var>promise</var> be a new Promise.
1. If [=this=]'s [=relevant global object=]'s [=associated Document=] is not [=fully active=] then return [=a promise rejected with=] "{{InvalidStateError}}" {{DOMException}}.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's [=this=] here? I am assuming it is the parent BaseAudioContext, but the link "this" leads to an abstract description of this in WebIDL. I hope there's a better way to express the association.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When a Document is not fully active, where does a "rejected promise" go? Or is this some sort of formality defined somewhere?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The [=something=] notation refers to exported definitions that are globally exposed. I would have expected some sort of name-spacing per spec, but I don't know how to do it and haven't found anything.

When describing a method, this is the object on which the method has been called, I think it's clear enough.

When a document is not fully active, the promise is returned rejected, and it goes wherever the author of the code wants it to go.


2. Let <var>promise</var> be a new Promise.

2. If the operation <a href="https://tc39.github.io/ecma262/#sec-isdetachedbuffer"><code>IsDetachedBuffer</code></a>
3. If the operation <a href="https://tc39.github.io/ecma262/#sec-isdetachedbuffer"><code>IsDetachedBuffer</code></a>
(described in [[!ECMASCRIPT]]) on {{BaseAudioContext/decodeAudioData(audioData, successCallback, errorCallback)/audioData!!argument}} is
<code>false</code>, execute the following steps:

Expand All @@ -1121,14 +1123,14 @@ Methods</h4>

3. Queue a decoding operation to be performed on another thread.

3. Else, execute the following error steps:
4. Else, execute the following error steps:

1. Let <var>error</var> be a {{DataCloneError}}.
2. Reject <var>promise</var> with <var>error</var>, and remove it from
{{BaseAudioContext/[[pending promises]]}}.
3. <a>Queue a task</a> to invoke {{BaseAudioContext/decodeAudioData()/errorCallback!!argument}} with <var>error</var>.

4. Return <var>promise</var>.
5. Return <var>promise</var>.
</div>

<div algorithm="queue a decode operation">
Expand Down Expand Up @@ -1493,6 +1495,8 @@ Methods</h4>
<div algorithm="AudioContext.close()">
<span class="synchronous">When close is called, execute these steps:</span>

1. If [=this=]'s [=relevant global object=]'s [=associated Document=] is not [=fully active=] then return [=a promise rejected with=] "{{InvalidStateError}}" {{DOMException}}.

1. Let <var>promise</var> be a new Promise.

1. If the <a>control thread state</a> flag on the
Expand Down Expand Up @@ -1676,6 +1680,8 @@ Methods</h4>
<span class="synchronous">When resume is called,
execute these steps:</span>

1. If [=this=]'s [=relevant global object=]'s [=associated Document=] is not [=fully active=] then return [=a promise rejected with=] "{{InvalidStateError}}" {{DOMException}}.

1. Let <var>promise</var> be a new Promise.

2. If the <a>control thread state</a> on the
Expand Down Expand Up @@ -1761,6 +1767,8 @@ Methods</h4>
<div algorithm="AudioContext.suspend()">
<span class="synchronous">When suspend is called, execute these steps:</span>

1. If [=this=]'s [=relevant global object=]'s [=associated Document=] is not [=fully active=] then return [=a promise rejected with=] "{{InvalidStateError}}" {{DOMException}}.

1. Let <var>promise</var> be a new Promise.

2. If the <a>control thread state</a> on the
Expand Down Expand Up @@ -2025,6 +2033,8 @@ Methods</h4>
thread</a>:</span>

<ol>
<li>If [=this=]'s [=relevant global object=]'s [=associated Document=] is not [=fully active=] then return [=a promise rejected with=] "{{InvalidStateError}}" {{DOMException}}.

<li>If the {{[[rendering started]]}} slot on the
{{OfflineAudioContext}} is <em>true</em>, return a rejected
promise with {{InvalidStateError}}, and abort these
Expand Down Expand Up @@ -2107,6 +2117,10 @@ Methods</h4>
<span class="synchronous">When resume is called,
execute these steps:</span>

1. If [=this=]'s [=relevant global object=]'s [=associated Document=] is
not [=fully active=] then return [=a promise rejected with=]
"{{InvalidStateError}}" {{DOMException}}.

1. Let <var>promise</var> be a new Promise.

1. Abort these steps and reject <var>promise</var> with
Expand Down