@@ -5573,11 +5573,10 @@ given a <var>document</var>, <var>localName</var>, <var>prefix</var>, <var>names
5573
5573
<var> A</var> is in its
5574
5574
<a for=Element>attribute list</a> .
5575
5575
5576
- This specification uses and
5577
- <a lt="other applicable specifications">applicable specifications</a> can use the hooks an
5578
- <dfn export>attribute is set</dfn> , an <dfn export>attribute is changed</dfn> , an
5579
- <dfn export>attribute is added</dfn> , and an <dfn export>attribute is removed</dfn> , for
5580
- further processing of the <a>attribute</a> 's <a for=Attr>value</a> .
5576
+ This and <a lt="other applicable specifications">other specifications</a> may define
5577
+ <dfn id=concept-element-attributes-change-ext>attribute change steps</dfn> for
5578
+ <a for=/>elements</a> . The algorithm is passed <var> element</var> , <var> localName</var> ,
5579
+ <var> oldValue</var> , <var> value</var> , and <var> namespace</var> .
5581
5580
5582
5581
To <dfn export id=concept-element-attributes-change lt="change an attribute">change</dfn> an
5583
5582
<a>attribute</a> <var> attribute</var>
@@ -5598,11 +5597,12 @@ to <var>value</var>, run these steps:
5598
5597
list containing <var> attribute</var> 's <a for=Attr>local name</a>, <var>attribute</var>' s
5599
5598
<a for=Attr>value</a> , <var> value</var> , and <var> attribute</var> 's <a for=Attr>namespace</a> .
5600
5599
5600
+ <li><p> Run the <a>attribute change steps</a> with <var> element</var> , <var> attribute</var> 's
5601
+ <a for=Attr>local name</a> , <var> attribute</var> 's <a for=Attr>value</a> , <var> value</var> , and
5602
+ <var> attribute</var> 's <a for=Attr>namespace</a> .
5603
+
5601
5604
<li> Set <var> attribute</var> 's
5602
5605
<a for=Attr>value</a> to <var> value</var> .
5603
-
5604
- <li> An <a>attribute is set</a> and an
5605
- <a>attribute is changed</a> .
5606
5606
</ol>
5607
5607
5608
5608
To <dfn export id=concept-element-attributes-append lt="append an attribute">append</dfn> an
@@ -5623,14 +5623,15 @@ run these steps:
5623
5623
list containing <var> attribute</var> 's <a for=Attr>local name</a>, null, <var>attribute</var>' s
5624
5624
<a for=Attr>value</a> , and <var> attribute</var> 's <a for=Attr>namespace</a> .
5625
5625
5626
+ <li><p> Run the <a>attribute change steps</a> with <var> element</var> , <var> attribute</var> 's
5627
+ <a for=Attr>local name</a> , null, <var> attribute</var> 's <a for=Attr>value</a> , and
5628
+ <var> attribute</var> 's <a for=Attr>namespace</a> .
5629
+
5626
5630
<li> Append the <var> attribute</var> to the <var> element</var> 's
5627
5631
<a for=Element>attribute list</a> .
5628
5632
5629
5633
<li> Set <var> attribute</var> 's
5630
5634
<a for=Attr>element</a> to <var> element</var> .
5631
-
5632
- <li> An <a>attribute is set</a> and an
5633
- <a>attribute is added</a> .
5634
5635
</ol>
5635
5636
5636
5637
To <dfn export id=concept-element-attributes-remove lt="remove an attribute">remove</dfn> an
@@ -5652,14 +5653,16 @@ run these steps:
5652
5653
list containing <var> attribute</var> 's <a for=Attr>local name</a>, <var>attribute</var>' s
5653
5654
<a for=Attr>value</a> , null, and <var> attribute</var> 's <a for=Attr>namespace</a> .
5654
5655
5656
+ <li><p> Run the <a>attribute change steps</a> with <var> element</var> , <var> attribute</var> 's
5657
+ <a for=Attr>local name</a> , <var> attribute</var> 's <a for=Attr>value</a> , null, and
5658
+ <var> attribute</var> 's <a for=Attr>namespace</a> .
5659
+
5655
5660
<li> Remove <var> attribute</var> from the
5656
5661
<var> element</var> 's
5657
5662
<a for=Element>attribute list</a> .
5658
5663
5659
5664
<li> Set <var> attribute</var> 's
5660
5665
<a for=Attr>element</a> to null.
5661
-
5662
- <li> An <a>attribute is removed</a> .
5663
5666
</ol>
5664
5667
5665
5668
To <dfn export id=concept-element-attributes-replace lt="replace an attribute">replace</dfn> an
@@ -5678,14 +5681,16 @@ in an <a for="/">element</a> <var>element</var>, run these steps:
5678
5681
<a for=Attr>value</a> , <var> newAttr</var> 's <a for=Attr>value</a>, and <var>oldAttr</var>' s
5679
5682
<a for=Attr>namespace</a> .
5680
5683
5684
+ <li><p> Run the <a>attribute change steps</a> with <var> element</var> , <var> oldAttr</var> 's
5685
+ <a for=Attr>local name</a> , <var> oldAttr</var> 's <a for=Attr>value</a>, <var>newAttr</var>' s
5686
+ <a for=Attr>value</a> , and <var> oldAttr</var> 's <a for=Attr>namespace</a> .
5687
+
5681
5688
<li><p> Replace <var> oldAttr</var> by <var> newAttr</var> in the <var> element</var> 's
5682
5689
<a for=Element>attribute list</a> .
5683
5690
5684
5691
<li><p> Set <var> oldAttr</var> 's <a for=Attr>element</a> to null.
5685
5692
5686
5693
<li><p> Set <var> newAttr</var> 's <a for=Attr>element</a> to <var> element</var> .
5687
-
5688
- <li><p> An <a>attribute is set</a> and an <a>attribute is changed</a> .
5689
5694
</ol>
5690
5695
5691
5696
<hr>
@@ -5825,24 +5830,15 @@ the HTML <code>id</code> <a>attribute</a> and a DTD. This specification makes <a
5825
5830
concept of the DOM and allows for only one per <a for="/">element</a> , given by an
5826
5831
<a lt="named attribute"><code>id</code> attribute</a> .
5827
5832
5828
- When an <a for="/">element</a> is created that
5829
- <a lt="has an attribute">has</a> an
5830
- <a lt="named attribute"><code>id</code> attribute</a> whose
5831
- <a for=Attr>value</a> is not the empty string or
5832
- when an <a for="/">element</a> 's
5833
- <a lt="named attribute"><code>id</code> attribute</a> is
5834
- <a lt="attribute is set">set</a> to a
5835
- <a for=Attr>value</a> other than the empty
5836
- string, set the <a for="/">element</a> 's
5837
- <a>ID</a> to the new
5838
- <a for=Attr>value</a> .
5833
+ <p> Use these <a>attribute change steps</a> to update an <a for=/>element</a> 's <a>ID</a> :
5839
5834
5840
- When an <a for="/">element</a> 's
5841
- <a lt="named attribute"><code>id</code> attribute</a> is
5842
- <a lt="attribute is removed">removed</a> or
5843
- <a lt="attribute is set">set</a> to the empty string, unset the
5844
- <a for="/">element</a> 's
5845
- <a>ID</a> .
5835
+ <ol>
5836
+ <li><p> If <var> localName</var> is <code> id</code> , <var> namespace</var> is null, and
5837
+ <var> value</var> is null or the empty string, then unset <var> element</var> 's <a>ID</a> .
5838
+
5839
+ <li><p> Otherwise, if <var> localName</var> is <code> id</code> , <var> namespace</var> is null, then
5840
+ set <var> element</var> 's <a>ID</a> to <var> value</var> .
5841
+ </ol>
5846
5842
5847
5843
<p class="note no-backref"> While this specification defines requirements for <code> class</code> ,
5848
5844
<code> id</code> , and <code> slot</code> <a>attributes</a> on any <a for="/">element</a> , it makes no
@@ -9203,17 +9199,33 @@ are to return the result of running <a>get an attribute value</a> given the asso
9203
9199
9204
9200
<hr>
9205
9201
9206
- <p> When a {{DOMTokenList}} object is created and its associated <a for="/">element</a>
9207
- <a lt="has an attribute">has</a> an
9208
- <a lt="named attribute"><var>associated attribute's local name</var> attribute</a> or
9209
- associated <a for="/">element</a> 's
9210
- <a lt="named attribute"><var>associated attribute's local name</var> attribute</a> is
9211
- <a lt="attribute is set">set</a> , set <a>tokens</a> to the new <a for=Attr>value</a> ,
9212
- <a lt="ordered set parser">parsed</a> .
9213
-
9214
- <p> When an associated <a for="/">element</a> 's
9215
- <a lt="named attribute"><var>associated attribute's local name</var> attribute</a> is
9216
- <a lt="attribute is removed">removed</a> , set <a>tokens</a> to the empty set.
9202
+ <p> A {{DOMTokenList}} object has these <a>attribute change steps</a> for its associated
9203
+ <a for=/>element</a> :
9204
+
9205
+ <ol>
9206
+ <li><p> If <var> localName</var> is associated attribute's <a for=Attr>local name</a> ,
9207
+ <var> namespace</var> is null, and <var> value</var> is null, then set <a>tokens</a> to the empty
9208
+ set.
9209
+
9210
+ <li><p> Otherwise, <var> localName</var> is associated attribute's <a for=Attr>local name</a> ,
9211
+ <var> namespace</var> is null, then set <a>tokens</a> to <var> value</var> ,
9212
+ <a lt="ordered set parser">parsed</a> .
9213
+ </ol>
9214
+
9215
+ <p> When a {{DOMTokenList}} object is created, run these substeps:
9216
+
9217
+ <ol>
9218
+ <li><p> Let <var> element</var> be associated <a for=/>element</a> .
9219
+
9220
+ <li><p> Let <var> localName</var> be associated attribute's <a for=Attr>local name</a> .
9221
+
9222
+ <li><p> Let <var> value</var> be the result of
9223
+ <a lt="get an attribute by namespace and local name">getting an attribute</a> given null,
9224
+ <var> localName</var> , and <var> element</var> .
9225
+
9226
+ <li><p> Run the <a>attribute change steps</a> for <var> element</var> , <var> localName</var> ,
9227
+ <var> value</var> , <var> value</var> , and null.
9228
+ </ol>
9217
9229
9218
9230
<dl class="domintro">
9219
9231
<dt><code><var> tokenlist</var> . {{DOMTokenList/length}} </code>
0 commit comments