Re: [heycam/webidl] [Exposed] section unnecessarily restrictive about partial interface + members (#515)

[Exposed] on an interface serves two completely independent (tho usually linked in practice) purposes: it sets the exposure of the constructor functions, and it sets the default exposure for all the members of the interface.  It generally makes sense that the latter must be a subset of the former; you shouldn't have members that are only visible in realms where you're not allowed to construct the objects that the members are on.

On a partial interface, you only have the latter use (since the constructor functions' visibility is defined by the original interface definition already).  It's perfectly fine for the "default" exposure from the partial to not be a superset of an individual member's exposure, as long as both of them are subsets of the original interface's exposure; it's the same as the partial in your example *not* defining an [Exposed], then having two members, one of which is [Exposed=Foo] and the other which is [Exposed=Bar].

(I don't have a use-case for this, I was just confused by the section for an unrelated reason before figuring things out, then realized this restriction was unnecessary.)

-- 
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/515#issuecomment-361816797

Received on Wednesday, 31 January 2018 04:01:48 UTC