@@ -4281,7 +4281,7 @@ empty string instead, and then do as described below, switching on the interface
4281
4281
4282
4282
<dl class=switch>
4283
4283
<dt> {{Attr}}
4284
- <dd><p> <a>Set an existing attribute value</a> with <a>this</a> , the given value, and "Node nodeValue" .
4284
+ <dd><p> <a>Set an existing attribute value</a> with <a>this</a> , the given value.
4285
4285
4286
4286
<dt> {{CharacterData}}
4287
4287
<dd><p> <a>Replace data</a> with node <a>this</a> , offset 0, count <a>this</a> 's
@@ -4334,8 +4334,7 @@ do as defined below, switching on the interface <var>node</var> <a>implements</a
4334
4334
<dd><p> <a>String replace all</a> with <var> value</var> within <var> node</var> .
4335
4335
4336
4336
<dt> {{Attr}}
4337
- <dd><p> <a>Set an existing attribute value</a> with <var> node</var> , <var> value</var> and
4338
- "Node textContent".
4337
+ <dd><p> <a>Set an existing attribute value</a> with <var> node</var> , <var> value</var> .
4339
4338
4340
4339
<dt> {{CharacterData}}
4341
4340
<dd><p> <a>Replace data</a> with node <var> node</var> , offset 0, count <var> node</var> 's
@@ -4458,7 +4457,8 @@ dom-Range-extractContents, dom-Range-cloneContents -->
4458
4457
<ol>
4459
4458
<li><p> Let <var> copyAttribute</var> be a <a>clone</a> of <var> attribute</var> .
4460
4459
4461
- <li><p> <a lt="append an attribute">Append</a> <var> copyAttribute</var> to <var> copy</var> .
4460
+ <li><p> <a lt="append an attribute">Append</a> <var> copyAttribute</var> to <var> copy</var> ,
4461
+ with false.
4462
4462
</ol>
4463
4463
</li>
4464
4464
</ol>
@@ -6371,26 +6371,36 @@ given a <var>document</var>, <var>localName</var>, <var>namespace</var>, and opt
6371
6371
</ol>
6372
6372
6373
6373
<p> To <dfn export id=concept-element-attributes-change lt="change an attribute">change</dfn> an
6374
- <a>attribute</a> <var> attribute</var> to <var> value</var> , with string <var> sink </var> , run these steps:
6374
+ <a>attribute</a> <var> attribute</var> to <var> value</var> , run these steps:
6375
6375
6376
6376
<ol>
6377
6377
<li><p> Let <var> oldValue</var> be <var> attribute</var> 's <a for=Attr>value</a> .</p></li>
6378
6378
6379
6379
<li><p> <a>Validate and set attribute value</a> <var> value</var> for <var> attribute</var> , with
6380
- <var> attribute</var> 's <a for=Attr>element</a> , and <var> sink </var> .
6380
+ <var> attribute</var> 's <a for=Attr>element</a> .
6381
6381
6382
- <li><p> <a>Handle attribute changes</a> for <var> attribute</var> with <var> attribute</var> 's
6383
- <a for=Attr>element</a> , <var> oldValue</var> , and <var> value</var> .
6382
+ <li><p> If <var> attribute</var> 's <a for=Attr>element</a> <a lt="has an attribute">has</a>
6383
+ an <a>attribute</a> <var> attribute</var> , then <a>handle attribute changes</a> for
6384
+ <var> attribute</var> with <var> attribute</var> 's <a for=Attr>element</a> , <var> oldValue</var> , and
6385
+ <var> value</var> .
6386
+
6387
+ <li><p> Otherwise, throw an "{{InvalidStateError!!exception}} " {{DOMException}} .
6384
6388
</ol>
6385
6389
6386
6390
<p> To <dfn export id=concept-element-attributes-append lt="append an attribute">append</dfn> an
6387
6391
<a>attribute</a> <var> attribute</var> to an <a for=/>element</a> <var> element</var> , with optional
6388
- string <var> sink </var> (default "" ), run these steps:
6392
+ boolean <var> validate </var> (default true ), run these steps:
6389
6393
6390
6394
<ol>
6391
- <li><p> If <var> sink</var> is not an empty string <a>Validate and set attribute value</a>
6392
- <var> attribute</var> 's <a for="Attr">value</a> for <var> attribute</var> with <var> element</var> ,
6393
- and <var> sink</var> .
6395
+ <li>
6396
+ <p> If <var> validate</var> , then:
6397
+ <ol>
6398
+ <li><p> <a>Validate and set attribute value</a>
6399
+ <var> attribute</var> 's <a for="Attr">value</a> for <var> attribute</var> with <var> element</var> .
6400
+
6401
+ <li><p> If <var> element</var> <a lt="has an attribute">has</a> an <a>attribute</a>
6402
+ <var> attribute</var> , then throw an "{{InvalidStateError!!exception}} " {{DOMException}} .
6403
+ </ol>
6394
6404
6395
6405
<li><p> <a for=list>Append</a> <var> attribute</var> to <var> element</var> 's
6396
6406
<a for=Element>attribute list</a> .
@@ -6435,12 +6445,12 @@ string <var>sink</var> (default ""), run these steps:
6435
6445
6436
6446
<p> To <dfn id=concept-element-attributes-validate-and-set-value>validate and set attribute value</dfn>
6437
6447
{{TrustedType}} or a string <var> value</var> for an <a>attribute</a> <var> attribute</var> , with
6438
- <a for=/>element</a> <var> element</var> , and string <var> sink </var> :
6448
+ <a for=/>element</a> <var> element</var> :
6439
6449
6440
6450
<ol>
6441
6451
<li><p> Let <var> validValue</var> be the result of calling
6442
6452
<a abstract-op>get Trusted Types-compliant attribute value</a> for <var> attribute</var> , with
6443
- <var> element</var> , <var> value</var> , and <var> sink </var> . [[!TRUSTED-TYPES]]
6453
+ <var> element</var> , <var> value</var> . [[!TRUSTED-TYPES]]
6444
6454
6445
6455
<li><p> Set <var> attribute</var> 's <a for=Attr>value</a> to <var> validValue</var> .
6446
6456
</ol>
@@ -6494,8 +6504,7 @@ string <var>namespace</var> (default null):</p>
6494
6504
6495
6505
<div algorithm>
6496
6506
<p> To <dfn export id=concept-element-attributes-set>set an attribute</dfn> given an
6497
- <a for=/>attribute</a> <var> attr</var> , an <a for=/>element</a> <var> element</var> ,
6498
- and a string <var> sink</var> :
6507
+ <a for=/>attribute</a> <var> attr</var> , an <a for=/>element</a> <var> element</var> .
6499
6508
6500
6509
<ol>
6501
6510
<li><p> If <var> attr</var> 's <a for=Attr>element</a> is neither null nor <var> element</var> ,
@@ -6513,13 +6522,16 @@ and a string <var>sink</var>:
6513
6522
6514
6523
<ul>
6515
6524
<li><p> <a>Validate and set attribute value</a> <var> attr</var> 's <a for="Attr">value</a> for
6516
- <var> attr</var> with <var> element</var> , and <var> sink</var> .
6525
+ <var> attr</var> with <var> element</var> .
6526
+
6527
+ <li><p> If <var> element</var> <a lt="has an attribute">has</a> an <a>attribute</a>
6528
+ <var> attr</var> , then <a lt="replace an attribute">replace</a> <var> oldAttr</var> with
6529
+ <var> attr</var> .
6517
6530
6518
- <li><p> <a lt="replace an attribute">Replace</a> <var> oldAttr </var> with <var> attr </var> .
6531
+ <li><p> Otherwise, throw an " {{InvalidStateError!!exception}} " {{DOMException}} .
6519
6532
</ul>
6520
6533
6521
- <li><p> Otherwise, <a lt="append an attribute">append</a> <var> attr</var> to <var> element</var>
6522
- with <var> sink</var> .
6534
+ <li><p> Otherwise, <a lt="append an attribute">append</a> <var> attr</var> to <var> element</var> .
6523
6535
6524
6536
<li><p> Return <var> oldAttr</var> .
6525
6537
</ol>
@@ -6529,7 +6541,7 @@ and a string <var>sink</var>:
6529
6541
<p> To <dfn export id=concept-element-attributes-set-value>set an attribute value</dfn> given an
6530
6542
<a for=/>element</a> <var> element</var> , a string <var> localName</var> , a string or {{TrustedType}}
6531
6543
<var> value</var> , an optional null or string <var> prefix</var> (default null), an optional null
6532
- or string <var> namespace</var> (default null), and an optional string <var> sink </var> (default "") :
6544
+ or string <var> namespace</var> (default null):
6533
6545
6534
6546
<ol>
6535
6547
<li> Let <var> attribute</var> be the result of
@@ -6540,10 +6552,9 @@ or string <var>namespace</var> (default null), and an optional string <var>sink<
6540
6552
<var> namespace</var> , <a for=Attr>namespace prefix</a> is <var> prefix</var> ,
6541
6553
<a for=Attr>local name</a> is <var> localName</var> , <a for=Attr>value</a> is <var> value</var> , and
6542
6554
<a for=Node>node document</a> is <var> element</var> 's <a for=Node>node document</a> , then
6543
- <a lt="append an attribute">append</a> this <a>attribute</a> to <var> element</var> with
6544
- <var> sink</var> , and then return.
6555
+ <a lt="append an attribute">append</a> this <a>attribute</a> to <var> element</var> , and then return.
6545
6556
6546
- <li><p> <a lt="change an attribute">Change</a> <var> attribute</var> to <var> value</var> , with <var> sink </var> .
6557
+ <li><p> <a lt="change an attribute">Change</a> <var> attribute</var> to <var> value</var> .
6547
6558
</ol>
6548
6559
</div>
6549
6560
@@ -6804,13 +6815,12 @@ method steps are:
6804
6815
and null otherwise.
6805
6816
<!-- This is step 2 of "get an attribute by name", modified as appropriate -->
6806
6817
6807
- <li><p> If <var> attribute</var> is null, create an <a>attribute</a> whose
6808
- <a for=Attr>local name</a> is <var> qualifiedName</var> , <a for=Attr>value</a> is
6809
- <var> value</var> , and <a for=Node>node document</a> is <a>this</a> 's <a for=Node>node document</a> ,
6810
- then <a lt="append an attribute">append</a> this <a>attribute</a> to <a>this</a> with
6811
- "Element setAttribute", and then return.
6818
+ <li><p> If <var> attribute</var> is null, create an <a>attribute</a> whose
6819
+ <a for=Attr>local name</a> is <var> qualifiedName</var> , <a for=Attr>value</a> is
6820
+ <var> value</var> , and <a for=Node>node document</a> is <a>this</a> 's <a for=Node>node document</a> ,
6821
+ then <a lt="append an attribute">append</a> this <a>attribute</a> to <a>this</a> , and then return.
6812
6822
6813
- <li><p> <a lt="change an attribute">Change</a> <var> attribute</var> to <var> value</var> , with "Element setAttribute" .
6823
+ <li><p> <a lt="change an attribute">Change</a> <var> attribute</var> to <var> value</var> .
6814
6824
</ol>
6815
6825
6816
6826
<p> The
@@ -6822,7 +6832,7 @@ method steps are:
6822
6832
passing <var> namespace</var> and <var> qualifiedName</var> to <a>validate and extract</a> .
6823
6833
6824
6834
<li><p> <a>Set an attribute value</a> for <a>this</a> using <var> localName</var> , <var> value</var> ,
6825
- and also <var> prefix</var> and <var> namespace</var> , and "Element setAttributeNS" .
6835
+ and also <var> prefix</var> and <var> namespace</var> .
6826
6836
</ol>
6827
6837
6828
6838
<p> The
@@ -6871,8 +6881,8 @@ method steps are:
6871
6881
<li><p> If <var> force</var> is not given or is true, create an <a>attribute</a> whose
6872
6882
<a for=Attr>local name</a> is <var> qualifiedName</var> , <a for=Attr>value</a> is the empty
6873
6883
string, and <a for=Node>node document</a> is <a>this</a> 's <a for=Node>node document</a> , then
6874
- <a lt="append an attribute">append</a> this <a>attribute</a> to <a>this</a> with
6875
- "Element toggleAttribute", and then return true.
6884
+ <a lt="append an attribute">append</a> this <a>attribute</a> to <a>this</a> ,
6885
+ and then return true.
6876
6886
6877
6887
<li><p> Return false.
6878
6888
</ol>
@@ -6910,11 +6920,11 @@ method steps are to return the result of
6910
6920
6911
6921
<p> The <dfn method for=Element><code>setAttributeNode(<var>attr</var>)</code></dfn> methods steps are to
6912
6922
return the result of <a lt="set an attribute">setting an attribute</a> given <var> attr</var> and
6913
- <a>this</a> , and "Element setAttributeNode" .
6923
+ <a>this</a> .
6914
6924
6915
6925
<p> The <dfn method for=Element><code>setAttributeNodeNS(<var>attr</var>)</code></dfn> methods steps are to
6916
6926
return the result of <a lt="set an attribute">setting an attribute</a> given <var> attr</var> ,
6917
- <a>this</a> , and "Element setAttributeNodeNS" .
6927
+ <a>this</a> .
6918
6928
6919
6929
<p> The <dfn method for=Element><code>removeAttributeNode(<var>attr</var>)</code></dfn> method steps
6920
6930
are:
@@ -7271,11 +7281,11 @@ method steps are to return the result of
7271
7281
7272
7282
<p> The <dfn method for=NamedNodeMap><code>setNamedItem(<var>attr</var>)</code></dfn> method steps are
7273
7283
to return the result of <a lt="set an attribute">setting an attribute</a> given <var> attr</var> ,
7274
- <a for=NamedNodeMap>element</a> , and "NamedNodeMap setNamedItem" .
7284
+ <a for=NamedNodeMap>element</a> .
7275
7285
7276
7286
<p> The <dfn method for=NamedNodeMap><code>setNamedItemNS(<var>attr</var>)</code></dfn> method steps are
7277
7287
to return the result of <a lt="set an attribute">setting an attribute</a> given <var> attr</var> ,
7278
- <a for=NamedNodeMap>element</a> , and "NamedNodeMap setNamedItemNS" .
7288
+ <a for=NamedNodeMap>element</a> .
7279
7289
7280
7290
<p> The <dfn method for=NamedNodeMap><code>removeNamedItem(<var>qualifiedName</var>)</code></dfn>
7281
7291
method steps are:
@@ -7380,14 +7390,13 @@ null.
7380
7390
<a for=Attr>value</a> .
7381
7391
7382
7392
<p> To <dfn>set an existing attribute value</dfn> , given an <a>attribute</a> <var> attribute</var> ,
7383
- string <var> value</var> , and string <var> sink </var> , run these steps:
7393
+ string <var> value</var> , run these steps:
7384
7394
7385
7395
<ol>
7386
7396
<li><p> If <var> attribute</var> 's <a for=Attr>element</a> is null, then set <var>attribute</var>' s
7387
7397
<a for=Attr>value</a> to <var> value</var> .
7388
7398
7389
- <li><p> Otherwise, <a lt="change an attribute">change</a> <var> attribute</var> to <var> value</var> ,
7390
- with <var> sink</var> .
7399
+ <li><p> Otherwise, <a lt="change an attribute">change</a> <var> attribute</var> to <var> value</var> .
7391
7400
</ol>
7392
7401
7393
7402
<p> The {{Attr/value}} setter steps are to <a>set an existing attribute value</a> with <a>this</a> ,
0 commit comments