Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use WebIDL enumerations, not numeric constants #235

Closed
olivierthereaux opened this issue Sep 11, 2013 · 3 comments
Closed

Use WebIDL enumerations, not numeric constants #235

olivierthereaux opened this issue Sep 11, 2013 · 3 comments

Comments

@olivierthereaux
Copy link
Contributor

Originally reported on W3C Bugzilla ISSUE-17323 Tue, 05 Jun 2012 11:15:44 GMT
Reported by Philip Jägenstedt
Assigned to

Audio-ISSUE-18 (NumericConstants): Use WebIDL enumerations, not numeric constants [Web Audio API]

http://www.w3.org/2011/audio/track/issues/18

Raised by: Philip Jägenstedt
On product: Web Audio API

http://dev.w3.org/2006/webapi/WebIDL/#idl-enums

Use of numeric constants in interface definitions is not good practice for new specs. The WebRTC WG has resolved to move away from this:

http://lists.w3.org/Archives/Public/public-script-coord/2012JanMar/0166.html
http://lists.w3.org/Archives/Public/public-script-coord/2012JanMar/0320.html

In HTML, TextTrack.mode was recently changed to enumerations after similar feedback:

http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#texttrackmode

These are the members with numeric constants in the Web Audio API spec:

AudioBufferSourceNode.playbackState
AudioPannerNode.panningModel
AudioPannerNode.distanceModel
BiquadFilterNode.type
Oscillator.type
Oscillator.playbackState

@olivierthereaux
Copy link
Contributor Author

Original comment by Olivier Thereaux on W3C Bugzilla. Thu, 07 Jun 2012 15:54:40 GMT

Comments from Chris Rogers, 18 May 2012

Agreed - looking into the details of the exact WebIDL syntax...

http://dev.w3.org/2006/webapi/WebIDL/#idl-enums

@olivierthereaux
Copy link
Contributor Author

Original comment by Ehsan Akhgari [:ehsan] on W3C Bugzilla. Fri, 24 Aug 2012 19:33:42 GMT

Web IDL enumerations are only meant to be used for strings.

@olivierthereaux
Copy link
Contributor Author

Original comment by Olivier Thereaux on W3C Bugzilla. Mon, 10 Sep 2012 10:15:56 GMT

WebIDL fixed per Bug 17777.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant