@@ -6366,10 +6366,13 @@ given a <var>document</var>, <var>localName</var>, <var>namespace</var>, and opt
6366
6366
</ol>
6367
6367
6368
6368
<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:
6371
6371
6372
6372
<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
+
6373
6376
<li><p> <a for=list>Append</a> <var> attribute</var> to <var> element</var> 's
6374
6377
<a for=Element>attribute list</a> .
6375
6378
@@ -6486,13 +6489,18 @@ and a string <var>sink</var>:
6486
6489
6487
6490
<li><p> If <var> oldAttr</var> is <var> attr</var> , return <var> attr</var> .
6488
6491
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>
6491
6494
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> .
6494
6498
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> .
6496
6504
6497
6505
<li><p> Return <var> oldAttr</var> .
6498
6506
</ol>
@@ -6509,21 +6517,12 @@ or string <var>namespace</var> (default null), and an optional string <var>sink<
6509
6517
<a lt="get an attribute by namespace and local name">getting an attribute</a> given
6510
6518
<var> namespace</var> , <var> localName</var> , and <var> element</var> .
6511
6519
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.
6527
6526
6528
6527
<li><p> <a lt="change an attribute">Change</a> <var> attribute</var> to <var> value</var> , with <var> sink</var> .
6529
6528
</ol>
@@ -6786,21 +6785,11 @@ method steps are:
6786
6785
and null otherwise.
6787
6786
<!-- This is step 2 of "get an attribute by name", modified as appropriate -->
6788
6787
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.
6804
6793
6805
6794
<li><p> <a lt="change an attribute">Change</a> <var> attribute</var> to <var> value</var> , with "Element setAttribute".
6806
6795
</ol>
@@ -6863,8 +6852,8 @@ method steps are:
6863
6852
<li><p> If <var> force</var> is not given or is true, create an <a>attribute</a> whose
6864
6853
<a for=Attr>local name</a> is <var> qualifiedName</var> , <a for=Attr>value</a> is the empty
6865
6854
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.
6868
6857
6869
6858
<li><p> Return false.
6870
6859
</ol>
0 commit comments