Skip to content

Commit f3b99aa

Browse files
committed
Add [Exposed=*] to expose on all globals
This patch adds support in WebIDL for declaring an interface available in all contexts. Closes #468
1 parent 2b1a990 commit f3b99aa

File tree

1 file changed

+32
-5
lines changed

1 file changed

+32
-5
lines changed

index.bs

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5963,6 +5963,17 @@ which form (or forms) it is in:
59635963
<code>[Exposed=(Window,Worker)]</code>
59645964
</td>
59655965
</tr>
5966+
<tr>
5967+
<td>
5968+
<emu-nt><a href="#prod-ExtendedAttributeIdentList">ExtendedAttributeWildcard</a></emu-nt>
5969+
</td>
5970+
<td>
5971+
<dfn id="dfn-xattr-wildcard" for="extended attribute" export>takes a wildcard</dfn>
5972+
</td>
5973+
<td>
5974+
<code>[Exposed=*]</code>
5975+
</td>
5976+
</tr>
59665977

59675978
</table>
59685979

@@ -6024,6 +6035,7 @@ five forms are allowed.
60246035
"="
60256036
"&gt;"
60266037
"?"
6038+
"*"
60276039
"ByteString"
60286040
"DOMString"
60296041
"FrozenArray"
@@ -6083,6 +6095,11 @@ five forms are allowed.
60836095
identifier "=" identifier
60846096
</pre>
60856097

6098+
<pre class="grammar" id="prod-ExtendedAttributeWildcard">
6099+
ExtendedAttributeWildcard :
6100+
identifier "=" "*"
6101+
</pre>
6102+
60866103
<pre class="grammar" id="prod-ExtendedAttributeIdentList">
60876104
ExtendedAttributeIdentList :
60886105
identifier "=" "(" IdentifierList ")"
@@ -7984,8 +8001,9 @@ being exposed only on the [=primary global interface=].
79848001
The [{{Exposed}}]
79858002
[=extended attribute=]
79868003
must either
7987-
[=takes an identifier|take an identifier=] or
7988-
[=takes an identifier list|take an identifier list=].
8004+
[=takes an identifier|take an identifier=],
8005+
[=takes an identifier list|take an identifier list=] or
8006+
[=takes a wildcard|take a wildcard=].
79898007
Each of the identifiers mentioned must be
79908008
a [=global name=].
79918009

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

8000-
* If the [{{Exposed}}]
8001-
[=extended attribute=]
8002-
is specified on the construct, then the [=exposure set=]
8018+
* If the [{{Exposed}}] [=extended attribute=] [=takes a wildcard=], then the
8019+
[=exposure set=] is the set of all interfaces which have a [{{Global}}]
8020+
or [{{PrimaryGlobal}}] [=extended attribute=].
8021+
<p class="advisement">
8022+
<code>[Exposed=*]</code> should be used with care. It is only appropriate
8023+
when an interface does not expose significant new capabilities. If the
8024+
interface may be restricted or disabled in some environments, it is
8025+
recommended to list the globals explicitly.
8026+
</p>
8027+
* If the [{{Exposed}}] [=extended attribute=]
8028+
is specified on the construct with an identifier or identifier list, then
8029+
the [=exposure set=]
80038030
is the set of all interfaces that have a [=global name=]
80048031
that is listed in the extended attribute's argument.
80058032
* If the [{{Exposed}}]

0 commit comments

Comments
 (0)