Skip to content

Commit

Permalink
Add [Exposed=*] to expose on all globals
Browse files Browse the repository at this point in the history
This patch adds support in WebIDL for declaring an interface available
in all contexts.

Closes #468
  • Loading branch information
littledan committed Feb 22, 2018
1 parent 2b1a990 commit f3b99aa
Showing 1 changed file with 32 additions and 5 deletions.
37 changes: 32 additions & 5 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -5963,6 +5963,17 @@ which form (or forms) it is in:
<code>[Exposed=(Window,Worker)]</code>
</td>
</tr>
<tr>
<td>
<emu-nt><a href="#prod-ExtendedAttributeIdentList">ExtendedAttributeWildcard</a></emu-nt>
</td>
<td>
<dfn id="dfn-xattr-wildcard" for="extended attribute" export>takes a wildcard</dfn>
</td>
<td>
<code>[Exposed=*]</code>
</td>
</tr>

</table>

Expand Down Expand Up @@ -6024,6 +6035,7 @@ five forms are allowed.
"="
"&gt;"
"?"
"*"
"ByteString"
"DOMString"
"FrozenArray"
Expand Down Expand Up @@ -6083,6 +6095,11 @@ five forms are allowed.
identifier "=" identifier
</pre>

<pre class="grammar" id="prod-ExtendedAttributeWildcard">
ExtendedAttributeWildcard :
identifier "=" "*"
</pre>

<pre class="grammar" id="prod-ExtendedAttributeIdentList">
ExtendedAttributeIdentList :
identifier "=" "(" IdentifierList ")"
Expand Down Expand Up @@ -7984,8 +8001,9 @@ being exposed only on the [=primary global interface=].
The [{{Exposed}}]
[=extended attribute=]
must either
[=takes an identifier|take an identifier=] or
[=takes an identifier list|take an identifier list=].
[=takes an identifier|take an identifier=],
[=takes an identifier list|take an identifier list=] or
[=takes a wildcard|take a wildcard=].
Each of the identifiers mentioned must be
a [=global name=].

Expand All @@ -7997,9 +8015,18 @@ defining which global environments the construct can be used in.
The [=exposure set=]
for a given construct is defined as follows:

* If the [{{Exposed}}]
[=extended attribute=]
is specified on the construct, then the [=exposure set=]
* If the [{{Exposed}}] [=extended attribute=] [=takes a wildcard=], then the
[=exposure set=] is the set of all interfaces which have a [{{Global}}]
or [{{PrimaryGlobal}}] [=extended attribute=].
<p class="advisement">
<code>[Exposed=*]</code> should be used with care. It is only appropriate
when an interface does not expose significant new capabilities. If the
interface may be restricted or disabled in some environments, it is
recommended to list the globals explicitly.
</p>
* If the [{{Exposed}}] [=extended attribute=]
is specified on the construct with an identifier or identifier list, then
the [=exposure set=]
is the set of all interfaces that have a [=global name=]
that is listed in the extended attribute's argument.
* If the [{{Exposed}}]
Expand Down

0 comments on commit f3b99aa

Please sign in to comment.