Re: [heycam/webidl] [WIP] Add mixins (#433)

tobie commented on this pull request.



> +the [=member=] is declared on.
+
+Note: This is because [{{Exposed}}] extended attribute on partials are basicaly shorthand
+for annotating every [=member=] of the partial.
+
+If [{{Exposed}}] appears on a [=partial interface=] or [=partial namespace=],
+then the partial's [=own exposure set=] must be a subset of
+the [=exposure set=] of the partial's original [=interface=] or [=namespace=].
+
+If [{{Exposed}}] appears on an [=interface member|interface=] or [=namespace member=],
+then the [=member=]'s [=exposure set=] must be a subset
+of the [=exposure set=] of the [=interface=] or [=namespace=] it is a member of.
+
+If [{{Exposed}}] appears both on a [=partial mixin=] and its original [=mixin=],
+then the [=partial mixin=]'s [=own exposure set=]
+must be a subset of the [=mixin=]'s [=own exposure set=].

For two reasons:

1. Mixins can't have an exposure set as they're just a container for mixin members that melts away when included in an interface, just like a document fragment does when added to a document. They's need to have multiple exposure sets (corresponding to all of the interfaces they get included in), or they'd need to be copied whenever they're included somewhere. So far it seemed like a better mental model to only create copies of mixin members when a mixin is included, and not also of the mixin itself (nor its partial). That prevents us from giving mixins an exposure set, which I think is actually a good thing; their editorial aides, not constructs designed to have JS bindings and show up in the JS environment. 
2. For namespaces and interfaces, however, we can't rely solely on their "own exposure set"; we need to consider the case where they have none and need to default to « primary global ». This will no longer be an issue once we merge #423.

-- 
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/pull/433#discussion_r142009247

Received on Saturday, 30 September 2017 16:11:44 UTC