Re: [whatwg/webidl] Enumeration order of interface members (#432)

Things that might be hard for implementations:

- Interleaving attributes, operations, and constants
- Interleaving different partials and mixins

So I think this gives a few proposals:

- Total lexicographical order: direct interface members + mixins' members + partials' members, all mixed together, without regard for type, get sorted lexicographically and installed in order.
- Split by type: direct interface attributes + mixins' attributes + partials' attributes all mixed together and sorted lexicographically, then the same for constants, then the same for operations.
- Split by type and then source: something like
  - First direct interface attributes, ordered lexicographically
  - Then mixins' attributes, ordered lexicographically within each mixin and with the mixins ordered lexicographically by mixin name
  - Then partials attributes, ordered lexicographically within each mixin and... lexicographically within each partial by the first attribute or first operation in the partial?
  - Same process for constants
  - Same process for operations
- Split by source and then type
  - First direct interface attributes, ordered lexicographically
  - Then direct interface constants, ordered lexicographically,
  - ... etc.

(Note: I picked the ordering attributes, constants, operations arbitrarily. Gecko apparently does operations, attributes, constants and Chromium does attributes, constants, operations.)

Implementer input welcome on any preference among these. Based on some quick testing of `Reflect.ownKeys(Element.prototype)`, it seems like Chromium does something like "split by type and then source", although ordering within each source or among sources does not seem lexicographical. Gecko seems to mix together partials but not mixins...

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/webidl/issues/432#issuecomment-1285108715
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/webidl/issues/432/1285108715@github.com>

Received on Thursday, 20 October 2022 08:04:02 UTC