AudioContext() constructor should not throw error when invoked with argument

RESOLVED FIXED in Firefox 55

Status

()

Core
Web Audio
P2
normal
Rank:
25
RESOLVED FIXED
a year ago
10 months ago

People

(Reporter: Tomer Lahav, Assigned: padenot)

Tracking

({dev-doc-complete})

53 Branch
mozilla55
dev-doc-complete
Points:
---

Firefox Tracking Flags

(firefox55 fixed)

Details

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Reporter)

Description

a year ago
User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36

Steps to reproduce:

Run the following code:
new AudioContext({latencyHint: 'playback'});


Actual results:

Error is thrown:
TypeError: Argument 1 of AudioContext.constructor '[object Object]' is not a valid value for enumeration AudioChannel.


Expected results:

At the very least, this should not throw an error.
AudioContext() constructor should accept an options argument:
https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/AudioContext
current implementation doesn't match to the spec.

https://dxr.mozilla.org/mozilla-central/rev/48c0fd9c9ec5d68061ea7b59358874ae8da72572/dom/webidl/AudioContext.webidl#14
> [Constructor,
>  Constructor(AudioChannel audioChannelType),
>  Pref="dom.webaudio.enabled"]
> interface AudioContext : BaseAudioContext {

https://dxr.mozilla.org/mozilla-central/rev/48c0fd9c9ec5d68061ea7b59358874ae8da72572/dom/webidl/AudioChannel.webidl#41-50
> enum AudioChannel {
>   "normal",
>   "content",
>   "notification",
>   "alarm",
>   "telephony",
>   "ringer",
>   "publicnotification",
>   "system"
> };
Status: UNCONFIRMED → NEW
Component: Untriaged → Web Audio
Ever confirmed: true
Product: Firefox → Core
(Assignee)

Updated

a year ago
Assignee: nobody → padenot
Comment hidden (mozreview-request)

Comment 3

a year ago
mozreview-review
Comment on attachment 8864498 [details]
Bug 1361475 - Remove proprietary constructor on AudioContext.

https://reviewboard.mozilla.org/r/136172/#review139160
Attachment #8864498 - Flags: review?(amarchesini) → review+

Comment 4

a year ago
Pushed by paul@paul.cx:
https://hg.mozilla.org/integration/autoland/rev/68543862570f
Remove proprietary constructor on AudioContext. r=baku
Rank: 25
Priority: -- → P2

Comment 5

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/68543862570f
Status: NEW → RESOLVED
Last Resolved: a year ago
status-firefox55: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Keywords: dev-doc-needed
You need to log in before you can comment on or make changes to this bug.