speced / bikeshed

:bike: A preprocessor for anyone writing specifications that converts source files into actual specs.
https://speced.github.io/bikeshed
Creative Commons Zero v1.0 Universal
1.08k stars 199 forks source link

Linking event constructors #873

Open annevk opened 7 years ago

annevk commented 7 years ago

The [Constructor] bit of an Event class needs to link to https://dom.spec.whatwg.org/#concept-event-constructor. I believe there's no event that requires its own constructor at the moment. It's however not entirely possible to do this through Bikeshed I think.

Maybe there should be a way to claim any inherited classes as well from a constructor definition?

tabatkins commented 7 years ago

Okay, so it looks like I can reliably tell when an interface inherits from Event. You're saying that, in this circumstance, the associated constructor should auto-link to the link you provided, for all interfaces?

One problem I see right now is that CustomEvent has its own custom constructor, right there in DOM. ^_^

annevk commented 7 years ago

CustomEvent does not? Its constructor algorithm is the one I pointed to. One problem might be that you need the entire chain to end up at Event. E.g., MouseEvent inherits from UIEvent.

tabatkins commented 7 years ago

CustomEvent does not? Its constructor algorithm is the one I pointed to.

Ah, I was looking at the additional "detail" attribute, but didn't read the algo to see that that's automatically handled.

One problem might be that you need the entire chain to end up at Event. E.g., MouseEvent inherits from UIEvent.

Oh, hm, I don't track inheritance like that right now, so it won't work reliably; I can just extract inheritance information from a single IDL block. I'll put this on the back burner for now, and first look at possibly tracking inheritance.