Skip to content

Commit

Permalink
Update enforcement for toggleAttribute to match behaviour observed in…
Browse files Browse the repository at this point in the history
… Chrome.
  • Loading branch information
lukewarlow committed May 16, 2024
1 parent 6e40964 commit 2f00466
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -6918,19 +6918,29 @@ method steps are:
<p>If <var>attribute</var> is null, then:

<ol>
<li><p>If <var>force</var> is false, return false.

<li><p>Set <var>attribute</var> to an <a>attribute</a> whose
<a for=Attr>local name</a> is <var>qualifiedName</var>, <a for=Attr>value</a> is the empty
string, and <a for=Node>node document</a> is <a>this</a>'s <a for=Node>node document</a>.

<li><p>Let <var>verifiedValue</var> be the result of calling <a>verify attribute value</a>
<var>attribute</var>'s <a for=Attr>value</a> for <var>attribute</var>, with <a>this</a>.

<li><p>Set <var>attribute</var>'s <a for=Attr>value</a> to <var>verifiedValue</var>.
<li><p>Let <var>existingAttribute</var> be the first <a>attribute</a> in <a>this</a>'s
<a for=Element>attribute list</a> whose <a for=Attr>qualified name</a> is <var>qualifiedName</var>,
and null otherwise.

<li><p>If <var>existingAttribute</var> is null:
<ol>
<li><p>Set <var>attribute</var>'s <a for=Attr>value</a> to <var>verifiedValue</var>.

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

<li><p>If <var>force</var> is not given or is true, then <a lt="append an attribute">append</a>
this <a>attribute</a> to <a>this</a>, and then return true.
<li><p>Return true.
</ol>

<li><p>Return false.
<li><p>Set <var>existingAttribute</var>'s <a for=Attr>value</a> to <var>verifiedValue</var>.
</ol>

<li><p>Otherwise, if <var>force</var> is not given or is false,
Expand Down

0 comments on commit 2f00466

Please sign in to comment.