Skip to content

Commit

Permalink
Clarify and add examples for "extended attributes associated with"
Browse files Browse the repository at this point in the history
Closes #341.
  • Loading branch information
domenic committed May 10, 2017
1 parent d0899e9 commit 8e43020
Showing 1 changed file with 60 additions and 5 deletions.
65 changes: 60 additions & 5 deletions index.bs
Expand Up @@ -5992,21 +5992,76 @@ The following extended attributes are <dfn for="extended attributes">applicable
production, [=set/append=] each of the [=extended attributes=] present in the production's
<emu-nt><a href="#prod-ExtendedAttributeList">ExtendedAttributeList</a></emu-nt> to
|extended attributes|.

<div class="example">
<pre class="idl">
interface I {
attribute [XAttr] long attrib;
void f1(sequence<[XAttr] long> arg);
void f2(optional [XAttr] long arg);

maplike&lt;[XAttr2] DOMString, [XAttr3] long>;
};

dictionary D {
required [XAttr] long member;
};
</pre>
</div>
1. If |type| is a [=member type=] of a [=union type=] |U|, [=set/append=] each of the
[=extended attributes associated with=] |U| to |extended attributes|.

<div class="example">
<pre class="idl">
interface I {
attribute [XAttr] (long or Node) attrib;
};
</pre>
</div>
1. If |type| appears as part of a <emu-nt><a href="#prod-Type">Type</a></emu-nt> production
within an <emu-nt><a href="#prod-Argument">Argument</a></emu-nt> production, [=set/append=]
to |extended attributes| all of the [=extended attributes=] present in the production's
directly within an <emu-nt><a href="#prod-Argument">Argument</a></emu-nt> production,
[=set/append=] to |extended attributes| all of the [=extended attributes=] present in the
production's
<emu-nt><a href="#prod-ExtendedAttributeList">ExtendedAttributeList</a></emu-nt> that are
[=applicable to types=].

<div class="example">
<pre class="idl">
interface I {
void f([XAttr] long attrib);
};
</pre>

Note that this is an example of this step only if [<code>XAttr</code>] is
[=applicable to types=]; otherwise [<code>XAttr</code>] applies to the argument, and not
the argument's type.
</div>
1. If |type| appears as part of a <emu-nt><a href="#prod-Type">Type</a></emu-nt> production
within an <emu-nt><a href="#prod-DictionaryMember">DictionaryMember</a></emu-nt> production,
[=set/append=] to |extended attributes| all of the [=extended attributes=] present in the
production's
directly within an <emu-nt><a href="#prod-DictionaryMember">DictionaryMember</a></emu-nt>
production, [=set/append=] to |extended attributes| all of the [=extended attributes=]
present in the production's
<emu-nt><a href="#prod-ExtendedAttributeList">ExtendedAttributeList</a></emu-nt> that are
[=applicable to types=].

<div class="example">
<pre class="idl">
dictionary D {
[XAttr] long member;
};
</pre>

Note that this is an example of this step only if [<code>XAttr</code>] is
[=applicable to types=]; otherwise [<code>XAttr</code>] applies to the dictionary
member, and not the member's type.
</div>
1. If |type| is a [=typedef=], [=set/append=] the [=extended attributes associated with=] the
[=type being given a new name=] to |extended attributes|.

<div class="example">
<pre class="idl">
typedef [XAttr] long xlong;
</pre>
</div>
1. Return |extended attributes|.
</div>

Expand Down

0 comments on commit 8e43020

Please sign in to comment.