Re: [heycam/webidl] Adding slots [initial braindump] (#258)

> I'd go with just `[[children]]`. I think it's important the double brackets appear at declaration time,

Strongly agree. Having a syntactic distinction between slots and attributes makes my life (and BS users) a *ton* easier.

> In general an object is allocated with all the slots of its "main interface", any interfaces that one derives from, and any partial interfaces that extend anything in that chain, and any mixins mixed into anything in that chain. I bet there is a term already defined in Web IDL for this collection of interfaces.

Yeah.  In effect, slots are just Symbol-typed attributes, with the Symbols known only to the runtime and not otherwise exposed.  They inherit/etc exactly the same as attributes do.

> But to really get benefits, I think you need something that auto-associates certain attributes with slots, as discussed in Bugzilla.

I'd love it if every attribute implicitly had a backing slot, and Bikeshed could just make the definitions/links work.  If you have custom get/set behavior (like `innerHTML`) you might not actually *use* that implicit slot, and since its presence is otherwise unobservable, implementations can just not generate it.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/258#issuecomment-283203580

Received on Wednesday, 1 March 2017 01:23:13 UTC