Skip to content

Commit 4fa463f

Browse files
committed
Fix WebAudio#2149: Remove test for AudioContext from Media constructors
In the constructor algorithm for all of the Media nodes, the first item was a check that the context was an AudioContext. But the constructor requires an AudioContext, so the check is useless. Remove them.
1 parent e0d8770 commit 4fa463f

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

index.bs

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7795,9 +7795,7 @@ Constructors</h4>
77957795
<dl dfn-type=constructor dfn-for="MediaElementAudioSourceNode">
77967796
: <dfn>MediaElementAudioSourceNode(context, options)</dfn>
77977797
::
7798-
1. If <var>context</var> is not an {{AudioContext}}, throw an
7799-
{{NotSupportedError}} exception and abort these steps.
7800-
2. <a href="#audionode-constructor-init">initialize the AudioNode</a>
7798+
1. <a href="#audionode-constructor-init">initialize the AudioNode</a>
78017799
<var>this</var>, with <var>context</var> and <var>options</var> as arguments.
78027800

78037801
<pre class=argumentdef for="MediaElementAudioSourceNode/constructor(context, options)">
@@ -7900,9 +7898,7 @@ Constructors</h4>
79007898
<dl dfn-type=constructor dfn-for="MediaStreamAudioDestinationNode">
79017899
: <dfn>MediaStreamAudioDestinationNode(context, options)</dfn>
79027900
::
7903-
1. If <code>context</code> is not an {{AudioContext}}, throw an
7904-
{{NotSupportedError}} and abort these steps.
7905-
2. <a href="#audionode-constructor-init">Initialize the AudioNode</a>
7901+
1. <a href="#audionode-constructor-init">Initialize the AudioNode</a>
79067902
<var>this</var>, with <var>context</var> and <var>options</var> as arguments.
79077903

79087904
<pre class=argumentdef for="MediaStreamAudioDestinationNode/constructor(context, options)">
@@ -7958,25 +7954,23 @@ Constructors</h4>
79587954
<dl dfn-type=constructor dfn-for="MediaStreamAudioSourceNode">
79597955
: <dfn>MediaStreamAudioSourceNode(context, options)</dfn>
79607956
::
7961-
1. If <var>context</var> is not an {{AudioContext}}, throw an
7962-
{{NotSupportedError}} exception and abort these steps.
7963-
2. If the {{MediaStreamAudioSourceOptions/mediaStream}} member of
7957+
1. If the {{MediaStreamAudioSourceOptions/mediaStream}} member of
79647958
{{MediaStreamAudioSourceNode/MediaStreamAudioSourceNode()/options!!argument}} does not reference a
79657959
{{MediaStream}} that has at least one
79667960
{{MediaStreamTrack}} whose
79677961
<code>kind</code> attribute has the value <code>"audio"</code>,
79687962
throw an {{InvalidStateError}} and abort these steps. Else, let
79697963
this stream be <var>inputStream</var>.
7970-
3. Let <var>tracks</var> be the list of all
7964+
1. Let <var>tracks</var> be the list of all
79717965
{{MediaStreamTrack}}s of
79727966
<var>inputStream</var> that have a <code>kind</code> of
79737967
<code>"audio"</code>.
7974-
4. Sort the elements in <var>tracks</var> based on their <code>id</code>
7968+
1. Sort the elements in <var>tracks</var> based on their <code>id</code>
79757969
attribute using lexicographic ordering on sequences of code unit
79767970
values.
7977-
5. <a href="#audionode-constructor-init">Initialize the AudioNode</a>
7971+
1. <a href="#audionode-constructor-init">Initialize the AudioNode</a>
79787972
<var>this</var>, with <var>context</var> and <var>options</var> as arguments.
7979-
6. Set an internal slot <dfn attribute
7973+
1. Set an internal slot <dfn attribute
79807974
for="MediaStreamAudioSourceNode">[[input track]]</dfn> on this
79817975
{{MediaStreamAudioSourceNode}} to be the first element of
79827976
<var>tracks</var>. This is the track used as the input audio for this
@@ -8066,12 +8060,10 @@ Constructors</h4>
80668060
<dl dfn-type=constructor dfn-for="MediaStreamTrackAudioSourceNode">
80678061
: <dfn>MediaStreamTrackAudioSourceNode(context, options)</dfn>
80688062
::
8069-
1. If <var>context</var> is not an {{AudioContext}}, throw an
8070-
{{NotSupportedError}} exception and abort these steps.
8071-
2. If the {{MediaStreamTrackAudioSourceOptions/mediaStreamTrack}}'s
8063+
1. If the {{MediaStreamTrackAudioSourceOptions/mediaStreamTrack}}'s
80728064
<code>kind</code> attribute is not <code>"audio"</code>, throw an
80738065
{{InvalidStateError}} and abort these steps.
8074-
3. <a href="#audionode-constructor-init">Initialize the AudioNode</a>
8066+
1. <a href="#audionode-constructor-init">Initialize the AudioNode</a>
80758067
<var>this</var>, with <var>context</var> and <var>options</var> as arguments.
80768068

80778069
<pre class=argumentdef for="MediaStreamTrackAudioSourceNode/constructor(context, options)">

0 commit comments

Comments
 (0)