Skip to content

Commit

Permalink
Nullable types and attribute change steps
Browse files Browse the repository at this point in the history
  • Loading branch information
Alice Boxhall committed Jan 7, 2019
1 parent 53b52f8 commit 8f2d7e4
Showing 1 changed file with 26 additions and 11 deletions.
37 changes: 26 additions & 11 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -7369,8 +7369,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
return a <code>DOMTokenList</code> object whose associated element is the element in question and
whose associated attribute's local name is the name of the attribute in question.</p>

<p>If a reflecting IDL attribute <var>attr</var> has the type <code>Element</code>,
or an interface that inherits from <code>Element</code>, then:
<p>If a reflecting IDL attribute <var>attr</var> has the type <code
data-x=""><code>Element</code>?</code>, or an interface that inherits from <code
data-x=""><code>Element</code>?</code>, then:
<ul>
<li><p>This attribute defines an internal slot, [[<var>attr</var>AssociatedElement]], on the
attribute's element. The initial value for this slot is null.</p></li>
Expand Down Expand Up @@ -7425,13 +7426,20 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
</ol>
</li>

<li><p>If the content attribute is set directly (such as via <code
data-x="">Element.setAttribute()</code>), the value for the IDL attribute is reset to null.</p></li>
<li>
<p>The following <span data-x="concept-element-attributes-change-ext">attribute change
step</span> is used to synchronize between the content attribute and the IDL attribute:</p>
<ol>
<li><p>If <var>localName</var> is associated attribute’s local name, and <var>namespace</var>
is null, reset [[<var>attr</var>AssociatedElement]] to null.</p></li>
</ol>
</li>
</ul>

<p>If a reflecting IDL attribute <var>attr</var> has the type <code
data-x="">sequence&lt;<code>Element</code>&gt;</code>, or <code data-x="">sequence&lt;<var>T</var>&gt;</code> where
<var>T</var> inherits from <code>Element</code>, then:</p>
data-x="">sequence&lt;<code>Element</code>&gt;?</code>, or <code
data-x="">sequence&lt;<var>T</var>&gt;?</code> where <var>T</var> inherits from
<code>Element</code>, then:</p>

<ul>
<li><p>This attribute defines an internal slot, [[<var>attr</var>AssociatedElements]], on the
Expand All @@ -7447,10 +7455,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

<li><p>Otherwise, let <var>elements</var> be an empty list.</p></li>

<li>
<p><span data-x="list iterate">For each</span> <var>id</var> in the <span>set of space-separated
tokens</span>:</p>
<li><p>Let <var>tokens</var> be the content attribute's value, <span data-x="split a string on
ASCII whitespace">split on ASCII whitespace</span>.</p></li>

<li>
<p><span data-x="list iterate">For each</span> <var>id</var> in <var>tokens</var>:</p>
<ul>
<li><p>Let <var>candidate</var> be the first element within the content attribute's elements
<span>node document</span>'s descendants whose <span data-x="concept-ID">ID</span> is
Expand Down Expand Up @@ -7527,8 +7536,14 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
</ol>
</li>

<li><p>If the content attribute is set directly (such as via <code
data-x="">Element.setAttribute()</code>), the value for the IDL attribute is reset to null.</p></li>
<li>
<p>The following <span data-x="concept-element-attributes-change-ext">attribute change
step</span> is used to synchronize between the content attribute and the IDL attribute:</p>
<ol>
<li><p>If <var>localName</var> is associated attribute’s local name, and <var>namespace</var>
is null, reset [[<var>attr</var>AssociatedElements]] to null.</p></li>
</ol>
</li>
</ul>

</div>
Expand Down

0 comments on commit 8f2d7e4

Please sign in to comment.