Skip to content

Commit

Permalink
Remove throw from set an attribute and move TT check down to replace …
Browse files Browse the repository at this point in the history
…an attribute
  • Loading branch information
lukewarlow committed Apr 22, 2024
1 parent 53248c1 commit ba80870
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -6427,6 +6427,9 @@ boolean <var>validate</var> (default true), run these steps:
<a>attribute</a> <var>oldAttr</var> with an <a>attribute</a> <var>newAttr</var>, run these steps:

<ol>
<li><p><a>Validate and set attribute value</a> <var>newAttr</var>'s <a for="Attr">value</a> for
<var>newAttr</var> with <var>oldAttr</var>'s <a for=Attr>element</a>.

<li><p><a for=list>Replace</a> <var>oldAttr</var> by <var>newAttr</var> in <var>oldAttr</var>'s
<a for=Attr>element</a>'s <a for=Element>attribute list</a>.

Expand Down Expand Up @@ -6512,21 +6515,8 @@ string <var>namespace</var> (default null):</p>
<var>attr</var>'s <a for=Attr>namespace</a>, <var>attr</var>'s <a for=Attr>local name</a>, and
<var>element</var>.

<li><p>If <var>oldAttr</var> is <var>attr</var>, return <var>attr</var>.

<li>
<p>If <var>oldAttr</var> is non-null, then:</p>

<ul>
<li><p><a>Validate and set attribute value</a> <var>attr</var>'s <a for="Attr">value</a> for
<var>attr</var> with <var>element</var>.

<li><p>If <var>element</var> <a lt="has an attribute">has</a> an <a>attribute</a>
<var>attr</var>, then <a lt="replace an attribute">replace</a> <var>oldAttr</var> with
<var>attr</var>.

<li><p>Otherwise, throw an "{{InvalidStateError!!exception}}" {{DOMException}}.
</ul>
<li><p>If <var>oldAttr</var> is non-null, then <a lt="replace an attribute">replace</a>
<var>oldAttr</var> with <var>attr</var>.

<li><p>Otherwise, <a lt="append an attribute">append</a> <var>attr</var> to <var>element</var>.

Expand Down

0 comments on commit ba80870

Please sign in to comment.