Skip to content

Commit

Permalink
domenic comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Alice Boxhall committed Aug 14, 2018
1 parent ed16f20 commit 9b05471
Showing 1 changed file with 47 additions and 55 deletions.
102 changes: 47 additions & 55 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -7310,68 +7310,64 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
whose associated attribute's local name is the name of the attribute in question.</p>

<p>If a reflecting IDL attribute has the type <code>HTMLElement</code>,
or an interface that descends from <code>HTMLElement</code>,
or an interface that inherits from <code>HTMLElement</code>,
then it must be paired with another reflecting IDL attribute
that has the type <code data-x="idl-DOMString">DOMString?</code>.
The relationship between these two attributes is as follows:</p>

<ol>
<li>The attribute which has the type <code>HTMLElement</code>
should be named <code data-x=""><var>attr</var>Element</code>,
<ul>
<li><p>The attribute which has the type <code>HTMLElement</code>
must be named <code data-x=""><var>attr</var>Element</code>,
where the paired nullable <code data-x="idl-DOMString">DOMString</code> attribute is named
<code data-x=""><var>attr</var></code>.</li>
<code data-x=""><var>attr</var></code>.</p></li>

<li>On getting <code data-x=""><var>attr</var></code> attribute,
the IDL attribute must return the value of the content attribute,
or null if the content attribute does not exist on the element.</li>
<li><p>On getting <code data-x=""><var>attr</var></code> IDL attribute,
return the value of the content attribute,
or null if the content attribute does not exist on the element.</p></li>

<li>On getting the <code data-x=""><var>attr</var>Element</code> IDL attribute,
it must return the value previously set for <code data-x=""><var>attr</var>Element</code>,
or null if the value was not previously set or was deleted.
</li>
<li><p>On getting the <code data-x=""><var>attr</var>Element</code> IDL attribute,
return the value previously set for <code data-x=""><var>attr</var>Element</code>,
or null if the value was not previously set or was deleted.</p></li>

<li>On setting the <code data-x=""><var>attr</var></code> attribute,
it must run the following algorithm:
<li><p>On setting the <code data-x=""><var>attr</var></code> IDL attribute to
<var>newValue</var>, run the following algorithm:</p>
<ol>
<li>If the specified value is different from the previous value of the content attribute,
the stored value, if any, for <code data-x=""><var>attr</var>Element</code>
should be deleted.
<li>If the specified value is null, the content attribute must be removed,
and the algorithm terminated.
<li>Otherwise, the content attribute must be set to the specified value.
<li>If the specified value is not a valid value for the
<code data-x="attr-id">id</code> attribute,
the algorithm is terminated.
<li>Otherwise, let <var>candidate</var> be the element that the
<code data-x="dom-Document-getElementById">document.getElementById()</code> method
would find when called on the content attribute's element's node tree's
<span>root</span> if it were passed as its argument the current value
of the corresponding content attribute.</li>
<li>If <var>candidate</var> is not null, and it is type-compatible with the
<code data-x=""><var>attr</var>Element</code> IDL attribute,
<li><p>If <var>newValue</var> is different from
the current value of the content attribute,
delete the stored value, if any, for <code data-x=""><var>attr</var>Element</code>.
</p></li>
<li><p>If <var>newValue</var> is null, remove the content attribute and return.</p></li>
<li><p>Otherwise, set the content attribute to <var>newValue</var>.</p></li>
<li><p>Let <var>candidate</var> be the first element, in tree order,
within the descendants of the content attribute's element's node tree's root
whose ID is <var>newValue</var>, and null if there is no such element otherwise.</p></li>
<li><p>If <var>candidate</var> is not null, and it implements the interface given by
the type of the <code data-x=""><var>attr</var>Element</code> IDL attribute,
store <var>candidate</var> as the value for the
<code data-x=""><var>attr</var>Element</code> IDL attribute.
</li>
</p></li>
</ol>
</li>

<li>On setting the <code data-x=""><var>attr</var>Element</code> attribute,
it must run the following algorithm:</li>
<ol>
<li>If the given element is not in the element's node tree,
or its light tree if it exists,
or is not type-compatible with the IDL attribute,
then remove the <code data-x=""><var>attr</var></code> and return.
<li>Otherwise, let <var>id</var> be the empty string.</li>
<li>If the given element has an <code data-x="attr-id">id</code> attribute,
and has the same <span>tree</span> as the element of the attribute being set,
and the given element is the first element in that <span>tree</span>
whose <span data-x="concept-ID">ID</span> is the value
of that <code data-x="attr-id">id</code> attribute,
then let <var>id</var> be the value of that <code data-x="attr-id">id</code> attribute.</li>
<li>Set the <code data-x=""><var>attr</var></code> content attribute to <var>id</var>.</li>
<li><p>On setting the <code data-x=""><var>attr</var>Element</code> IDL attribute to
<var>newElement</var>, run the following algorithm:</p>
<ol>
<li><p>If <var>newElement</var> is not in the same tree as the element,
then remove the <code data-x=""><var>attr</var></code> content attribute and return.
</p></li>
<li><p>Otherwise, let <var>id</var> be the empty string.</p></li>
<li><p>If the given element has an <code data-x="attr-id">id</code> attribute,
and is in the same <span>tree</span> as the element of the attribute being set,
and the given element is the first element in that <span>tree</span>
whose <span data-x="concept-ID">ID</span> is the value
of that <code data-x="attr-id">id</code> attribute,
then let <var>id</var> be the value of that <code data-x="attr-id">id</code> attribute.
</p></li>
<li><p>Set the <code data-x=""><var>attr</var></code> content attribute to <var>id</var>.
</p></li>
</ol>
</ol>
</li>
</ul>

</div>

Expand Down Expand Up @@ -43295,9 +43291,9 @@ interface <dfn>HTMLLabelElement</dfn> : <span>HTMLElement</span> {

<p>The <code>label</code> element <span>represents</span> a caption in a user interface. The
caption can be associated with a specific form control<span w-nodev>, known as the
<code>label</code> element's <dfn>labeled control</dfn></span>, either using the <code
data-x="attr-label-for">for</code> attribute, or by putting the form control inside the
<code>label</code> element itself.</p>
<code>label</code> element's <dfn>labeled control</dfn></span>,
either using the <code data-x="dom-label-htmlForElement">htmlForElement</code> IDL attribute,
or by putting the form control inside the <code>label</code> element itself.</p>

<div w-nodev>

Expand All @@ -43306,11 +43302,7 @@ interface <dfn>HTMLLabelElement</dfn> : <span>HTMLElement</span> {

</div>
<p>The <code data-x="dom-label-htmlForElement">htmlForElement</code> IDL attribute
may be specified to indicate a
form control with which the caption is to be associated.
If the attribute is specified, the attribute's value must be a
<span data-x="category-label">labelable element</span>.
</p>
may be specified to indicate a form control with which the caption is to be associated.</p>

<div w-nodev>

Expand Down

0 comments on commit 9b05471

Please sign in to comment.