This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
It is not clear from http://heycam.github.io/webidl/#idl-enums how spec authors should name enum values, especially those that are composed of more than one word. The examples are all single words. "enumeration-values" might imply that dashes should be used to separate the words, but there seems to be uncertainty on this [1][2]. Please provide explicit guidance, including case and whether/how to separate words. Existing and active specs are inconsistent but seem to tend toward use of dashes: - Fetch is using a mix of concatenation and dashes: https://fetch.spec.whatwg.org/#requestcontext - Screen Orientation is using dashes: https://w3c.github.io/screen-orientation/#orientationtype-enum - Web Audio has one of each: http://webaudio.github.io/web-audio-api/ - WebRTC uses dashes: http://www.w3.org/TR/webrtc/ [1] http://lists.w3.org/Archives/Public/public-script-coord/2013OctDec/0184.html [2] http://lists.w3.org/Archives/Public/public-script-coord/2014OctDec/0147.html
And in Web Animations we use dashes to match the corresponding CSS keywords: http://w3c.github.io/web-animations/#the-playbackdirection-enumeration
Can we definitively say whether there is a preference for dashes for new specs? I need to add some multi-word names to a spec, so it would be nice to know what is preferred. Thanks.
Ping. This is blocking at least one bug in EME we would like to resolve.
I have a slight preference for using dashes (or spaces, but probably too late for that) when we can. Who else should weigh in here? We should get some advice added to the spec if there's agreement.
Yeah, let's just settle on dashes. More readable, and CSS is definitely going to be using dashes for anything they need.
I'd like to request that this bikeshed be painted to completion ASAP. I can live with dashes.
I think the conclusion is lowercase and either dashes or single word depending on the circumstances (e.g. ArrayBuffer becomes "arraybuffer", not "array-buffer"). I recommend going with that as a general guideline for now. It will likely take some time before IDL is updated.
https://github.com/heycam/webidl/commit/344ad419defdcd8df313119abe85819e254a8afb