Skip to content

Commit 2325396

Browse files
Simplify boolean logic for toggleAttribute()
1 parent 32efc48 commit 2325396

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

dom.bs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6606,20 +6606,19 @@ method, when invoked, must run these steps:
66066606
<p>If <var>attribute</var> is null, then:
66076607

66086608
<ol>
6609-
<li><p>If <var>force</var> is not given or is true, create an <a>attribute</a> whose
6609+
<li><p>If <var>force</var> is given and is false, return false.
6610+
6611+
<li><p>Create an <a>attribute</a> whose
66106612
<a for="Attr">local name</a> is <var>qualifiedName</var>, <a for=Attr>value</a> is the empty
66116613
string, and <a for=Node>node document</a> is the <a>context object</a>'s
66126614
<a for=Node>node document</a>, then <a lt="append an attribute">append</a> this <a>attribute</a>
66136615
to the <a>context object</a>, and then return true.
6614-
6615-
<li><p>Return false.
66166616
</ol>
66176617

6618-
<li><p>Otherwise, if <var>force</var> is not given or is false,
6619-
<a lt="remove an attribute by name">remove an attribute</a> given <var>qualifiedName</var> and the
6620-
<a>context object</a>, and then return false.
6618+
<li><p>Otherwise, if <var>force</var> is given and is true, return true.
66216619

6622-
<li><p>Return true.
6620+
<li><p><a lt="remove an attribute by name">Remove an attribute</a> given <var>qualifiedName</var> and the
6621+
<a>context object</a>, and then return false.
66236622
</ol>
66246623

66256624
<p>The

0 commit comments

Comments
 (0)