@@ -4487,8 +4487,7 @@ dom-Range-extractContents, dom-Range-cloneContents -->
4487
4487
<ol>
4488
4488
<li><p> Let <var> copyAttribute</var> be a <a>clone</a> of <var> attribute</var> .
4489
4489
4490
- <li><p> <a lt="append an attribute">Append</a> <var> copyAttribute</var> to <var> copy</var> ,
4491
- with false.
4490
+ <li><p> <a lt="append an attribute">Append</a> <var> copyAttribute</var> to <var> copy</var> .
4492
4491
</ol>
4493
4492
</li>
4494
4493
</ol>
@@ -6406,33 +6405,17 @@ given a <var>document</var>, <var>localName</var>, <var>namespace</var>, and opt
6406
6405
<ol>
6407
6406
<li><p> Let <var> oldValue</var> be <var> attribute</var> 's <a for=Attr>value</a> .</p></li>
6408
6407
6409
- <li><p> <a>Verify and set attribute value</a> <var> value</var> for <var> attribute</var> , with
6410
- <var> attribute</var> 's <a for=Attr>element</a> .
6408
+ <li><p> Set <var> attribute</var> 's <a for=Attr>value</a> to <var> value</var> .
6411
6409
6412
- <li><p> If <var> attribute</var> 's <a for=Attr>element</a>
6413
- <a lt="has an attribute">has an attribute</a> , then <a>handle attribute changes</a> for
6414
- <var> attribute</var> with <var> attribute</var> 's <a for=Attr>element</a> , <var> oldValue</var> , and
6415
- <var> value</var> .
6416
-
6417
- <li><p> Otherwise, throw an "{{InvalidStateError!!exception}} " {{DOMException}} .
6410
+ <li><p> <a>Handle attribute changes</a> for <var> attribute</var> with <var> attribute</var> 's
6411
+ <a for=Attr>element</a> , <var> oldValue</var> , and <var> value</var> .
6418
6412
</ol>
6419
6413
6420
6414
<p> To <dfn export id=concept-element-attributes-append lt="append an attribute">append</dfn> an
6421
- <a>attribute</a> <var> attribute</var> to an <a for=/>element</a> <var> element</var> , with an
6422
- optional boolean <var> validate </var> (default true) :
6415
+ <a>attribute</a> <var> attribute</var> to an <a for=/>element</a> <var> element</var> , run these
6416
+ steps :
6423
6417
6424
6418
<ol>
6425
- <li>
6426
- <p> If <var> validate</var> is true:
6427
-
6428
- <ol>
6429
- <li><p> <a>Verify and set attribute value</a>
6430
- <var> attribute</var> 's <a for="Attr">value</a> for <var> attribute</var> , with <var> element</var> .
6431
-
6432
- <li><p> If <var> element</var> <a lt="has an attribute">has</a> an <a>attribute</a>
6433
- <var> attribute</var> , then throw an "{{InvalidStateError!!exception}} " {{DOMException}} .
6434
- </ol>
6435
-
6436
6419
<li><p> <a for=list>Append</a> <var> attribute</var> to <var> element</var> 's
6437
6420
<a for=Element>attribute list</a> .
6438
6421
@@ -6461,9 +6444,6 @@ optional boolean <var>validate</var> (default true):
6461
6444
<a>attribute</a> <var> oldAttr</var> with an <a>attribute</a> <var> newAttr</var> , run these steps:
6462
6445
6463
6446
<ol>
6464
- <li><p> <a>Verify and set attribute value</a> <var> newAttr</var> 's <a for="Attr">value</a> for
6465
- <var> newAttr</var> , with <var> oldAttr</var> 's <a for=Attr>element</a> .
6466
-
6467
6447
<li><p> <a for=list>Replace</a> <var> oldAttr</var> by <var> newAttr</var> in <var> oldAttr</var> 's
6468
6448
<a for=Attr>element</a> 's <a for=Element>attribute list</a> .
6469
6449
@@ -6477,16 +6457,14 @@ optional boolean <var>validate</var> (default true):
6477
6457
<a for=Attr>value</a> .
6478
6458
</ol>
6479
6459
6480
- <p> To <dfn>verify and set attribute value</dfn>
6460
+ <p> To <dfn>verify attribute value</dfn>
6481
6461
{{TrustedType}} or string <var> value</var> for an <a>attribute</a> <var> attribute</var> , given an
6482
6462
<a for=/>Element</a> <var> element</var> :
6483
6463
6484
6464
<ol>
6485
- <li><p> Let <var> verifiedValue </var> be the result of calling
6465
+ <li><p> Return the result of calling
6486
6466
<a abstract-op>get Trusted Types-compliant attribute value</a> for <var> attribute</var> , with
6487
6467
<var> element</var> , <var> value</var> . [[!TRUSTED-TYPES]]
6488
-
6489
- <li><p> Set <var> attribute</var> 's <a for=Attr>value</a> to <var> verifiedValue</var> .
6490
6468
</ol>
6491
6469
6492
6470
<hr>
@@ -6551,6 +6529,11 @@ string <var>namespace</var> (default null):</p>
6551
6529
6552
6530
<li><p> If <var> oldAttr</var> is <var> attr</var> , return <var> attr</var> .
6553
6531
6532
+ <li><p> Let <var> verifiedValue</var> be the result of calling <a>verify attribute value</a>
6533
+ <var> attr</var> 's <a for=Attr>value</a> for <var> attr</var> , with <var> element</var> .
6534
+
6535
+ <li><p> Set <var> attr</var> 's <a for=Attr>value</a> to <var> verifiedValue</var> .
6536
+
6554
6537
<li><p> If <var> oldAttr</var> is non-null, then <a lt="replace an attribute">replace</a>
6555
6538
<var> oldAttr</var> with <var> attr</var> .
6556
6539
@@ -6571,14 +6554,30 @@ or string <var>namespace</var> (default null):
6571
6554
<a lt="get an attribute by namespace and local name">getting an attribute</a> given
6572
6555
<var> namespace</var> , <var> localName</var> , and <var> element</var> .
6573
6556
6574
- <li> If <var> attribute</var> is null, create an <a>attribute</a> whose <a for=Attr>namespace</a> is
6575
- <var> namespace</var> , <a for=Attr>namespace prefix</a> is <var> prefix</var> ,
6576
- <a for=Attr>local name</a> is <var> localName</var> , <a for=Attr>value</a> is <var> value</var> , and
6577
- <a for=Node>node document</a> is <var> element</var> 's <a for=Node>node document</a> , then
6578
- <a lt="append an attribute">append</a> this <a>attribute</a> to <var> element</var> , and then
6579
- return.
6557
+ <li><p> Let <var> attributeExists</var> be false if <var> attribute</var> is null, and true otherwise.
6558
+
6559
+ <li><p> If <var> attributeExists</var> is false, set <var> attribute</var> to an <a>attribute</a>
6560
+ whose <a for=Attr>namespace</a> is <var> namespace</var> , <a for=Attr>namespace prefix</a> is
6561
+ <var> prefix</var> , <a for=Attr>local name</a> is <var> localName</var> , <a for=Attr>value</a> is
6562
+ <var> value</var> , and <a for=Node>node document</a> is <var> element</var> 's <a for=Node>node
6563
+ document</a> .
6580
6564
6581
- <li><p> <a lt="change an attribute">Change</a> <var> attribute</var> to <var> value</var> .
6565
+ <li><p> Let <var> verifiedValue</var> be the result of calling <a>verify attribute value</a>
6566
+ <var> value</var> for <var> attribute</var> , with <var> element</var> .
6567
+
6568
+ <li><p> Set <var> attributeExists</var> to true if <var> element</var> <a lt="has an attribute">has
6569
+ an attribute</a> <var> attribute</var> ; otherwise false.
6570
+
6571
+ <li><p> If <var> attributeExists</var> is true, <a lt="change an attribute">change</a>
6572
+ <var> attribute</var> to <var> verifiedValue</var> .
6573
+
6574
+ <li><p> Otherwise:
6575
+ <ol>
6576
+ <li><p> Set <var> attribute</var> 's <a for=Attr>value</a> to <var> verifiedValue</var> .
6577
+
6578
+ <li><p> <a lt="append an attribute">Append</a> this <a>attribute</a> to
6579
+ <var> element</var> .
6580
+ </ol>
6582
6581
</ol>
6583
6582
</div>
6584
6583
@@ -6839,12 +6838,25 @@ method steps are:
6839
6838
and null otherwise.
6840
6839
<!-- This is step 2 of "get an attribute by name", modified as appropriate -->
6841
6840
6842
- <li><p> If <var> attribute</var> is null, create an <a>attribute</a> whose
6843
- <a for=Attr>local name</a> is <var> qualifiedName</var> , <a for=Attr>value</a> is
6844
- <var> value</var> , and <a for=Node>node document</a> is <a>this</a> 's <a for=Node>node document</a> ,
6845
- then <a lt="append an attribute">append</a> this <a>attribute</a> to <a>this</a> , and then return.
6841
+ <li><p> Let <var> attributeExists</var> be false if <var> attribute</var> is null, and true otherwise.
6842
+
6843
+ <li><p> If <var> attributeExists</var> is false, set <var> attribute</var> to an <a>attribute</a>
6844
+ whose <a for=Attr>local name</a> is <var> qualifiedName</var> , <a for=Attr>value</a> is
6845
+ <var> value</var> , and <a for=Node>node document</a> is <a>this</a> 's <a for=Node>node
6846
+ document</a> .
6847
+
6848
+ <li><p> Let <var> verifiedValue</var> be the result of calling <a>verify attribute value</a>
6849
+ <var> value</var> for <var> attribute</var> , with <a>this</a> .
6846
6850
6847
- <li><p> <a lt="change an attribute">Change</a> <var> attribute</var> to <var> value</var> .
6851
+ <li><p> Set <var> attribute</var> 's <a for=Attr>value</a> to <var> verifiedValue</var> .
6852
+
6853
+ <li><p> Set <var> attributeExists</var> to true if <a>this</a> <a lt="has an attribute">has an
6854
+ attribute</a> <var> attribute</var> ; otherwise false.
6855
+
6856
+ <li><p> If <var> attributeExists</var> is true, <a lt="change an attribute">change</a>
6857
+ <var> attribute</var> to <var> value</var> .
6858
+
6859
+ <li><p> Otherwise <a lt="append an attribute">append</a> this <a>attribute</a> to <a>this</a> .
6848
6860
</ol>
6849
6861
6850
6862
<p> The
@@ -7414,7 +7426,13 @@ string <var>value</var>, run these steps:
7414
7426
<li><p> If <var> attribute</var> 's <a for=Attr>element</a> is null, then set <var>attribute</var>' s
7415
7427
<a for=Attr>value</a> to <var> value</var> .
7416
7428
7417
- <li><p> Otherwise, <a lt="change an attribute">change</a> <var> attribute</var> to <var> value</var> .
7429
+ <li><p> Otherwise:
7430
+ <ol>
7431
+ <li><p> Let <var> verifiedValue</var> be the result of calling <a>verify attribute value</a>
7432
+ <var> value</var> for <var> attribute</var> , with <a>this</a> .
7433
+
7434
+ <li><p> <a lt="change an attribute">Change</a> <var> attribute</var> to <var> verifiedValue</var> .
7435
+ </ol>
7418
7436
</ol>
7419
7437
7420
7438
<p> The {{Attr/value}} setter steps are to <a>set an existing attribute value</a> with <a>this</a>
0 commit comments