Skip to content

Commit 543336c

Browse files
Abstract away creating an attribute from toggleAttribute() and setAttribute()
1 parent 63a9c3e commit 543336c

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

Diff for: dom.bs

+19-12
Original file line numberDiff line numberDiff line change
@@ -6189,6 +6189,22 @@ in an <a for="/">element</a> <var>element</var>, run these steps:
61896189

61906190
<hr>
61916191

6192+
6193+
To <dfn export id=concept-element-attributes-set-by-name>create an attribute by value</dfn>
6194+
given a <var>qualifiedName</var>, <var>value</var> and <a for="/">element</a> <var>element</var>, run these steps:
6195+
6196+
<ol>
6197+
<li><p>Create an <a>attribute</a> whose
6198+
<a for="Attr">local name</a> is <var>qualifiedName</var>, <a for=Attr>value</a> is
6199+
<var>value</var>, and <a for=Node>node document</a> is <a>context object</a>'s
6200+
<a for=Node>node document</a>.
6201+
6202+
<li><a lt="append an attribute">Append</a> this <a>attribute</a> to
6203+
<a>element</a>
6204+
6205+
<li>Return.
6206+
</ol>
6207+
61926208
To <dfn export id=concept-element-attributes-get-valid-by-name>get a valid attribute by name</dfn>
61936209
given a <var>qualifiedName</var>, and <a for="/">element</a> <var>element</var>, run these steps:
61946210

@@ -6548,11 +6564,8 @@ method, when invoked, must run these steps:
65486564
<ol>
65496565
<li><p>Let <var>qualifiedName</var> and <var>attribute</var> be the result of running <a>get a valid attribute by name</a> given the <var>qualifiedName</var> and <a>context object</a>
65506566

6551-
<li><p>If <var>attribute</var> is null, create an <a>attribute</a> whose
6552-
<a for="Attr">local name</a> is <var>qualifiedName</var>, <a for=Attr>value</a> is
6553-
<var>value</var>, and <a for=Node>node document</a> is <a>context object</a>'s
6554-
<a for=Node>node document</a>, then <a lt="append an attribute">append</a> this <a>attribute</a> to
6555-
<a>context object</a>, and then return.
6567+
6568+
<li><p>If <var>attribute</var> is null, run <a>create an attribute by value</a> given the <var>qualifiedName</var>, <var>value</var> and <a>context object</a>, and then return.
65566569

65576570
<li><p><a lt="change an attribute">Change</a> <var>attribute</var> from <a>context object</a> to
65586571
<var>value</var>.
@@ -6606,13 +6619,7 @@ method, when invoked, must run these steps:
66066619
<ol>
66076620
<li><p>If <var>force</var> is given and is false, return false.
66086621

6609-
<li><p>Create an <a>attribute</a> whose
6610-
<a for="Attr">local name</a> is <var>qualifiedName</var>, <a for=Attr>value</a> is the empty
6611-
string, and <a for=Node>node document</a> is the <a>context object</a>'s
6612-
<a for=Node>node document</a>.
6613-
6614-
<li><a lt="append an attribute">Append</a> this <a>attribute</a>
6615-
to the <a>context object</a>.
6622+
<li><p>Run <a>create an attribute by value</a> given the <var>qualifiedName</var>, <var>the empty string</var> and <a>context object</a>.
66166623

66176624
<li>Return true.
66186625
</ol>

0 commit comments

Comments
 (0)