Skip to content

Commit 3562fcb

Browse files
committed
Move validate and set attribute into append an attribute
1 parent 6565089 commit 3562fcb

File tree

1 file changed

+28
-39
lines changed

1 file changed

+28
-39
lines changed

dom.bs

+28-39
Original file line numberDiff line numberDiff line change
@@ -6366,10 +6366,13 @@ given a <var>document</var>, <var>localName</var>, <var>namespace</var>, and opt
63666366
</ol>
63676367

63686368
<p>To <dfn export id=concept-element-attributes-append lt="append an attribute">append</dfn> an
6369-
<a>attribute</a> <var>attribute</var> to an <a for=/>element</a> <var>element</var>, run these
6370-
steps:
6369+
<a>attribute</a> <var>attribute</var> to an <a for=/>element</a> <var>element</var>, with
6370+
<var>sink</var>, run these steps:
63716371

63726372
<ol>
6373+
<li><p><a>Validate and set attribute value</a> <var>attribute</var>'s <a for="Attr">value</a> for
6374+
<var>attribute</var> with <var>element</var>, and <var>sink</var>.
6375+
63736376
<li><p><a for=list>Append</a> <var>attribute</var> to <var>element</var>'s
63746377
<a for=Element>attribute list</a>.
63756378

@@ -6486,13 +6489,18 @@ and a string <var>sink</var>:
64866489

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

6489-
<li><p><a>Validate and set attribute value</a> <var>newAttr</var>'s <a for="Attr">value</a> for
6490-
<var>newAttr</var> with <var>element</var>, and <var>sink</var>.
6492+
<li>
6493+
<p>If <var>oldAttr</var> is non-null, then:</p>
64916494

6492-
<li><p>If <var>oldAttr</var> is non-null, then <a lt="replace an attribute">replace</a>
6493-
<var>oldAttr</var> with <var>attr</var>.
6495+
<ul>
6496+
<li><p><a>Validate and set attribute value</a> <var>attr</var>'s <a for="Attr">value</a> for
6497+
<var>attr</var> with <var>element</var>, and <var>sink</var>.
64946498

6495-
<li><p>Otherwise, <a lt="append an attribute">append</a> <var>attr</var> to <var>element</var>.
6499+
<li><p><a lt="replace an attribute">Replace</a> <var>oldAttr</var> with <var>attr</var>.
6500+
</ul>
6501+
6502+
<li><p>Otherwise, <a lt="append an attribute">append</a> <var>attr</var> to <var>element</var>
6503+
with <var>sink</var>.
64966504

64976505
<li><p>Return <var>oldAttr</var>.
64986506
</ol>
@@ -6509,21 +6517,12 @@ or string <var>namespace</var> (default null), and an optional string <var>sink<
65096517
<a lt="get an attribute by namespace and local name">getting an attribute</a> given
65106518
<var>namespace</var>, <var>localName</var>, and <var>element</var>.
65116519

6512-
<li>
6513-
<p>If <var>attribute</var> is null, then:
6514-
<ol>
6515-
<li><p>Set <var>attribute</var> to a new <a>attribute</a> whose <a for=Attr>namespace</a> is
6516-
<var>namespace</var>, <a for=Attr>namespace prefix</a> is <var>prefix</var>,
6517-
<a for=Attr>local name</a> is <var>localName</var> and <a for=Node>node document</a> is
6518-
<var>element</var>'s <a for=Node>node document</a>.
6519-
6520-
<li><p><a>Validate and set attribute value</a> <var>value</var> for <var>attribute</var> with
6521-
<var>element</var>, and <var>sink</var>.
6522-
6523-
<li><p><a lt="append an attribute">Append</a> <var>attribute</var> to <var>element</var>.
6524-
6525-
<li><p>Return.
6526-
</ol>
6520+
<li>If <var>attribute</var> is null, create an <a>attribute</a> whose <a for=Attr>namespace</a> is
6521+
<var>namespace</var>, <a for=Attr>namespace prefix</a> is <var>prefix</var>,
6522+
<a for=Attr>local name</a> is <var>localName</var>, <a for=Attr>value</a> is <var>value</var>, and
6523+
<a for=Node>node document</a> is <var>element</var>'s <a for=Node>node document</a>, then
6524+
<a lt="append an attribute">append</a> this <a>attribute</a> to <var>element</var> with
6525+
<var>sink</var>, and then return.
65276526

65286527
<li><p><a lt="change an attribute">Change</a> <var>attribute</var> to <var>value</var>, with <var>sink</var>.
65296528
</ol>
@@ -6786,21 +6785,11 @@ method steps are:
67866785
and null otherwise.
67876786
<!-- This is step 2 of "get an attribute by name", modified as appropriate -->
67886787

6789-
<li>
6790-
<p>If <var>attribute</var> is null, then:
6791-
6792-
<ol>
6793-
<li><p>Set <var>attribute</var> to a new <a>attribute</a> whose <a for=Attr>local name</a> is
6794-
<var>qualifiedName</var> and <a for=Node>node document</a> is <a>this</a>'s
6795-
<a for=Node>node document</a>.
6796-
6797-
<li><p><a>Validate and set attribute value</a> <var>value</var> for <var>attribute</var>,
6798-
with <a>this</a> and "Element setAttribute".
6799-
6800-
<li><p><a lt="append an attribute">Append</a> <var>attribute</var> to <a>this</a>.
6801-
6802-
<li><p>Return.
6803-
</ol>
6788+
<li><p>If <var>attribute</var> is null, create an <a>attribute</a> whose
6789+
<a for=Attr>local name</a> is <var>qualifiedName</var>, <a for=Attr>value</a> is
6790+
<var>value</var>, and <a for=Node>node document</a> is <a>this</a>'s <a for=Node>node document</a>,
6791+
then <a lt="append an attribute">append</a> this <a>attribute</a> to <a>this</a> with
6792+
"Element setAttribute", and then return.
68046793

68056794
<li><p><a lt="change an attribute">Change</a> <var>attribute</var> to <var>value</var>, with "Element setAttribute".
68066795
</ol>
@@ -6863,8 +6852,8 @@ method steps are:
68636852
<li><p>If <var>force</var> is not given or is true, create an <a>attribute</a> whose
68646853
<a for=Attr>local name</a> is <var>qualifiedName</var>, <a for=Attr>value</a> is the empty
68656854
string, and <a for=Node>node document</a> is <a>this</a>'s <a for=Node>node document</a>, then
6866-
<a lt="append an attribute">append</a> this <a>attribute</a> to <a>this</a>, and then return
6867-
true.
6855+
<a lt="append an attribute">append</a> this <a>attribute</a> to <a>this</a> with
6856+
"Element toggleAttribute", and then return true.
68686857

68696858
<li><p>Return false.
68706859
</ol>

0 commit comments

Comments
 (0)