Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -7397,19 +7397,26 @@ namespace.</p>
is <var>namespace</var> and <a for=Attr>local name</a> is <var>localName</var>.
</dl>

<div algorithm>
<p>The <dfn method for=Element><code>hasAttributes()</code></dfn> method steps are to return false
if <a>this</a>'s <a for=Element>attribute list</a> <a for=list>is empty</a>; otherwise true.
</div>

<div algorithm>
<p>The <dfn attribute for=Element><code>attributes</code></dfn> getter steps are to return the
associated {{NamedNodeMap}}.
</div>

<div algorithm>
<p>The <dfn method for=Element><code>getAttributeNames()</code></dfn> method steps are to return the
<a for=Attr>qualified names</a> of the <a>attributes</a> in <a>this</a>'s
<a for=Element>attribute list</a>, in order; otherwise a new <a for=/>list</a>.

<p class=note>These are not guaranteed to be unique.<!-- A theoretical getAttributeNamesNS() could
return an array of unique two-value-arrays. -->
</div>

<div algorithm>
<p>The <dfn method for=Element><code>getAttribute(<var>qualifiedName</var>)</code></dfn> method
steps are:

Expand All @@ -7422,7 +7429,9 @@ steps are:

<li><p>Return <var>attr</var>'s <a for=Attr>value</a>.
</ol>
</div>

<div algorithm>
<p>The
<dfn method for=Element><code>getAttributeNS(<var>namespace</var>, <var>localName</var>)</code></dfn>
method steps are:
Expand All @@ -7436,7 +7445,9 @@ method steps are:

<li><p>Return <var>attr</var>'s <a for=Attr>value</a>.
</ol>
</div>

<div algorithm>
<p>The
<dfn method for=Element><code>setAttribute(<var>qualifiedName</var>, <var>value</var>)</code></dfn>
method steps are:
Expand Down Expand Up @@ -7472,15 +7483,17 @@ method steps are:

<li><p><a lt="append an attribute">Append</a> <var>attribute</var> to <a>this</a>.
</ol>
</div>

<div algorithm>
<p>The
<dfn method for=Element><code>setAttributeNS(<var>namespace</var>, <var>qualifiedName</var>, <var>value</var>)</code></dfn>
method steps are:

<ol>
<li><p>Let (<var>namespace</var>, <var>prefix</var>, <var>localName</var>) be the result of
[=validate and extract|validating and extracting=] <var>namespace</var> and
<var>qualifiedName</var> given "<code>element</code>".
<var>qualifiedName</var> given "<code>attribute</code>".

<li><p>Let <var>verifiedValue</var> be the result of calling
<a>get trusted type compliant attribute value</a> with <var>localName</var>, <var>namespace</var>,
Expand All @@ -7489,17 +7502,23 @@ method steps are:
<li><p><a>Set an attribute value</a> for <a>this</a> using <var>localName</var>,
<var>verifiedValue</var>, <var>prefix</var>, and <var>namespace</var>.
</ol>
</div>

<div algorithm>
<p>The
<dfn method for=Element><code>removeAttribute(<var>qualifiedName</var>)</code></dfn>
method steps are to <a lt="remove an attribute by name">remove an attribute</a> given
<var>qualifiedName</var> and <a>this</a>, and then return undefined.
</div>

<div algorithm>
<p>The
<dfn method for=Element><code>removeAttributeNS(<var>namespace</var>, <var>localName</var>)</code></dfn>
method steps are to <a lt="remove an attribute by namespace and local name">remove an attribute</a>
given <var>namespace</var>, <var>localName</var>, and <a>this</a>, and then return undefined.
</div>

<div algorithm>
<p>The <dfn method for=Element><code>hasAttribute(<var>qualifiedName</var>)</code></dfn> method
steps are:

Expand All @@ -7511,7 +7530,9 @@ steps are:
<li><p>Return true if <a>this</a> <a lt="has an attribute">has</a> an <a>attribute</a> whose
<a for=Attr>qualified name</a> is <var>qualifiedName</var>; otherwise false.
</ol>
</div>

<div algorithm>
<p>The
<dfn method for=Element><code>toggleAttribute(<var>qualifiedName</var>, <var>force</var>)</code></dfn>
method steps are:
Expand Down Expand Up @@ -7552,7 +7573,9 @@ method steps are:

<li><p>Return true.
</ol>
</div>

<div algorithm>
<p>The
<dfn method for=Element><code>hasAttributeNS(<var>namespace</var>, <var>localName</var>)</code></dfn>
method steps are:
Expand All @@ -7564,24 +7587,32 @@ method steps are:
<a for=Attr>namespace</a> is <var>namespace</var> and <a for=Attr>local name</a> is
<var>localName</var>; otherwise false.
</ol>
</div>

<hr>

<div algorithm>
<p>The <dfn method for=Element><code>getAttributeNode(<var>qualifiedName</var>)</code></dfn> method
steps are to return the result of <a lt="get an attribute by name">getting an attribute</a> given
<var>qualifiedName</var> and <a>this</a>.
</div>

<div algorithm>
<p>The
<dfn method for=Element><code>getAttributeNodeNS(<var>namespace</var>, <var>localName</var>)</code></dfn>
method steps are to return the result of
<a lt="get an attribute by namespace and local name">getting an attribute</a> given
<var>namespace</var>, <var>localName</var>, and <a>this</a>.
</div>

<div algorithm=Element/setAttributeNode>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come this one has a value?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see it's because there's two algorithms. I guess we could split them into two blocks but this is fine too.

<p>The <dfn method for=Element><code>setAttributeNode(<var>attr</var>)</code></dfn> and
<dfn method for=Element><code>setAttributeNodeNS(<var>attr</var>)</code></dfn> methods steps are to
return the result of <a lt="set an attribute">setting an attribute</a> given <var>attr</var> and
<a>this</a>.
</div>

<div algorithm>
<p>The <dfn method for=Element><code>removeAttributeNode(<var>attr</var>)</code></dfn> method steps
are:

Expand All @@ -7593,6 +7624,7 @@ are:

<li><p>Return <var>attr</var>.
</ol>
</div>

<hr>

Expand Down