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