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

Does anyone know if there’s been any further “news” on this front since this issue last got discussed?

> It's important to some extent for compatibility. E.g., we cannot change the order of some members on the 2D API as that would break sites. 

Spot checking, I haven’t turned up any prototype with more than two IDL-defined properties whose relative order is the same in both Blink and Gecko. I’m not sure if “2D” refers to CanvasRenderingContext2D or not, but if it does...

![Side by side of Edge & Firefox devtools showing very different enumeration order for properties of CanvasRenderingContext2D.prototype](https://user-images.githubusercontent.com/6257356/196597174-f43af268-2324-4d8c-852c-f1355cce47c2.png)

...then it looks like code that works in one but would break if its order changed is code that’s already broken in the other —unless it’s branching on user agent sniffing or just very “lucky”?

It seems like any observable runtime behavior that would arise from use of partials is at odds with their “specification editorial aide” role. It also seems undesirable for the use of mixins / the “Web IDL source text order” of members of any of these constructs to have runtime consequences and the current state of chaos seems like a substantial source of unnecessary entropy.

If there were a canonical order for named members, lexicographic or otherwise, I don’t think anything about the imperative steps would need to change. A fully-defined order that doesn’t teleport artifacts of editorial decisions, organizational structure, and the directory and file naming of a browser’s source text into the runtime seems very worthwhile regardless of what that specific order ends up being.

Cases where web-compat does demand a different order sounds like a `[LegacySomething]` unless they’re more common than I’d have hoped.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/webidl/issues/432#issuecomment-1283449684

You are receiving this because you are subscribed to this thread.

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

Received on Wednesday, 19 October 2022 05:27:37 UTC