jsdom / webidl2js

Auto-generate JS class structures for Web IDL specifications
MIT License
79 stars 29 forks source link

Support adding dynamic IDL strings to Transformer #188

Open ExE-Boss opened 4 years ago

ExE-Boss commented 4 years ago

This is a pain point I’ve encountered while trying to convert cssstyle to use WebIDL2JS.

I’m currently forced to generate ./src/CSSStyleDeclaration‑properties.webidl at build time, which contains the generated partial interface attributes:

TimothyGu commented 4 years ago

For reference, Blink just uses a getter/setter rather than implementing each attribute individually: https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/css/css_style_declaration.idl;l=1;drc=fdd99242518b07d1d48e6f8453cbb7963a27cb6a.

Gecko also has an IDL generation step: see https://searchfox.org/mozilla-central/source/dom/bindings/GenerateCSS2PropertiesWebIDL.py.

domenic commented 4 years ago

Generating IDL at build time, like Gecko, seems like the right approach to me.

ExE-Boss commented 4 years ago

I also generate them at build time, but I’d like to skip the writing to disk part.

domenic commented 4 years ago

That makes some sense, and perhaps should feed in to #160.