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

Switching the relative order of attributes and methods easy in Gecko.

Ordering each of those sets in some order like what https://github.com/heycam/webidl/issues/432#issuecomment-469268345 describes is work (we'd have to have a lot more complexity and state in the "build the interface member list" code than we do now), but pretty doable.

Having to have an order that interleaves attributes and methods (whether that's on a per-source basis or within sources, where a source is a mixin or partial interface definition) would be a big pain implementation-wise.

I guess mixins can't include other mixins, right?  That simplifies things a bit.

Within a mixin, presumably partials are also handled by the same approach as for interfaces, but affecting the overall order of mixins?

Concatenation of names does not provide unique sort keys.  Consider:
```
  partial interface A {
    readonly attribute long a;
    readonly attribute long bc;
  };
  partial interface A {
    readonly attribute long ab;
    readonly attribute long c;
  };
```
What we could do instead if sort by just first member name, which should be unique.  Especially if we prefix the name with "Regular", "Static", "Both" (for constants) or something, to deal with the static and non-static sharing names case.

One thing worth thinking about here:  Ideally the order of partials would not change when new things are added to the partials.  I think we get that if we use the first member as key, as long as people add things to the end...

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

Received on Monday, 4 March 2019 16:11:55 UTC