Closed domenic closed 10 years ago
One thing of interest here is that we should probably just standardize [Reflect]
. Why have all that unneeded potentially buggy prose?
But [Reflect]
is very HTML-specific, isn't it? Do we have any other parts of WebIDL that apply only to HTMLElements?
(I guess it could be made semi-generic if it said something like "let string be Invoke(this, "getAttribute"
, attrName). Perform conversions..." But that would be a web-observable change, since it would mandate that changing el.getAttribute
would cause el
's behavior with reflected properties to change.)
Well, we could make IDL extensible. Also, the whole idea of layering does not quite apply as IDL requires some stuff from HTML already, such as settings objects.
I like that idea. Specs could define their own IDL thingies when they use them enough. I will send a public-script-coord email to help us figure out our near-term plan.
This project is https://github.com/domenic/webidl-class-generator
Spawned from #31:
Given
plus the text
in the spec, we would commit an IDL file containing
Then we'd write the following ES6:
Things to note:
extends Bar
and anything related tox
since they are determined entirely by the IDLWhat will then happen is that we do something like
and
registerImpl
generates a wrapper classFoo
that delegates toFooImpl
and does all the other stuff determined by the IDL. If we were to write it out, it would look likeI am unsure whether we should generate the wrapper class at runtime or at compile time. Runtime seems easier off the top of my head, but that is partially because I do not have as much experience with parsers/generators as I would like.
Steps:
:
; generateextends
I will probably do this work in a separate repo. Will link as it happens.