Closed tabatkins closed 1 year ago
Thanks for this! I meant to look into writing the WebIDL but TypeScript felt easier initially. I'll copy this in to my latest change.
I've also updated the setting an invalid value to be a no-op rather than an exceptional event.
Decided to make a start on a bikeshed document for a "spec" it's no where near done but mostly just copying the readme into a bikeshed format.
I think what you've got is more than enough to get started with; no sense spending more effort on formatting until it proves necessary.
Your current API block is written in something that I guess is TS-derived? Here's the WebIDL that we'd want in an actual spec:
(Using enumerations like this makes things somewhat self-documenting. However, the default behavior for an attribute that's set to a value not in the enum is to just ignore the set, rather than throw: https://webidl.spec.whatwg.org/#idl-enums. We can override that manually, if desired, but matching platform convention is probably better.)