@@ -6355,13 +6355,9 @@ given a <var>document</var>, <var>localName</var>, <var>namespace</var>, and opt
6355
6355
<a>attribute</a> <var> attribute</var> to <var> value</var> , run these steps:
6356
6356
6357
6357
<ol>
6358
- <li><p> Set <var> value</var> to the result of calling <a>Get Trusted Types-compliant attribute
6359
- value</a> for <var> attribute</var> , with <var> attribute</var> 's <a for=Attr>element</a> and
6360
- <var> value</var> . [[!TRUSTED-TYPES]]
6361
-
6362
6358
<li><p> Let <var> oldValue</var> be <var> attribute</var> 's <a for=Attr>value</a> .</p></li>
6363
6359
6364
- <li><p> Set < var>attribute </var> 's <a for=Attr>value</a> to <var> value </var> .
6360
+ <li><p> <a>Validate and set attribute value</a> < var>value </var> for <var> attribute </var> , with <var> attribute </var> 's <a for=Attr>element</a > .
6365
6361
6366
6362
<li><p> <a>Handle attribute changes</a> for <var> attribute</var> with <var> attribute</var> 's
6367
6363
<a for=Attr>element</a> , <var> oldValue</var> , and <var> value</var> .
@@ -6372,11 +6368,6 @@ given a <var>document</var>, <var>localName</var>, <var>namespace</var>, and opt
6372
6368
steps:
6373
6369
6374
6370
<ol>
6375
- <li><p> Set <var> attribute</var> 's
6376
- <a for=Attr>value</a> to the result of calling <a>Get Trusted Types-compliant attribute value</a>
6377
- for <var> attribute</var> , with <var> element</var> and <var> attribute</var> 's <a for=Attr>value</a> .
6378
- [[!TRUSTED-TYPES]]
6379
-
6380
6371
<li><p> <a for=list>Append</a> <var> attribute</var> to <var> element</var> 's
6381
6372
<a for=Element>attribute list</a> .
6382
6373
@@ -6405,11 +6396,6 @@ steps:
6405
6396
<a>attribute</a> <var> oldAttr</var> with an <a>attribute</a> <var> newAttr</var> , run these steps:
6406
6397
6407
6398
<ol>
6408
- <li><p> Set <var> newAttr</var> 's
6409
- <a for=Attr>value</a> to the result of calling <a>Get Trusted Types-compliant attribute value</a>
6410
- for <var> newAttr</var> , with <var> oldAttr</var> 's <a for=Attr>element</a> and <var>newAttr</var>' s
6411
- <a for=Attr>value</a> .[[!TRUSTED-TYPES]]
6412
-
6413
6399
<li><p> <a for=list>Replace</a> <var> oldAttr</var> by <var> newAttr</var> in <var> oldAttr</var> 's
6414
6400
<a for=Attr>element</a> 's <a for=Element>attribute list</a> .
6415
6401
@@ -6423,6 +6409,14 @@ steps:
6423
6409
<a for=Attr>value</a> .
6424
6410
</ol>
6425
6411
6412
+ <p> To <dfn id=concept-element-attributes-validate-and-set-value>validate and set attribute value</dfn> <var> value</var> for an <a>attribute</a> <var> attribute</var> , with <a>element</a> <var> element</var> , run these steps:
6413
+
6414
+ <ol>
6415
+ <li><p> Let <var> validValue</var> be the result of calling <a>Get Trusted Types-compliant attribute value</a>
6416
+ for <var> attribute</var> , with <var> element</var> and <var> value</var> .[[!TRUSTED-TYPES]]
6417
+ <li><p> Set <var> attribute</var> 's <a for=Attr>value</a> to <var> validValue</var> .
6418
+ </ol>
6419
+
6426
6420
<hr>
6427
6421
6428
6422
<div algorithm>
@@ -6485,6 +6479,8 @@ string <var>namespace</var> (default null):</p>
6485
6479
6486
6480
<li><p> If <var> oldAttr</var> is <var> attr</var> , return <var> attr</var> .
6487
6481
6482
+ <li><p> <a>Validate and set attribute value</a> <var> newAttr</var> 's <a for="Attr">value</a> for <var> newAttr</var> with <var> element</var> .
6483
+
6488
6484
<li><p> If <var> oldAttr</var> is non-null, then <a lt="replace an attribute">replace</a>
6489
6485
<var> oldAttr</var> with <var> attr</var> .
6490
6486
@@ -6505,26 +6501,23 @@ an optional null or string <var>prefix</var> (default null), and an optional nul
6505
6501
<a lt="get an attribute by namespace and local name">getting an attribute</a> given
6506
6502
<var> namespace</var> , <var> localName</var> , and <var> element</var> .
6507
6503
6508
- <li><p> If <var> attribute</var> is null, then:
6504
+ <li> If <var> attribute</var> is null, create an <a>attribute</a> whose <a for=Attr>namespace</a> is
6505
+ <var> namespace</var> , <a for=Attr>namespace prefix</a> is <var> prefix</var> ,
6506
+ <a for=Attr>local name</a> is <var> localName</var> , <a for=Attr>value</a> is <var> value</var> , and
6507
+ <a for=Node>node document</a> is <var> element</var> 's <a for=Node>node document</a> , then
6508
+ <a lt="append an attribute">append</a> this <a>attribute</a> to <var> element</var> , and then
6509
+ return.
6509
6510
6510
6511
<ol>
6511
6512
<li><p> Set <var> attribute</var> to a new <a>attribute</a> whose <a for=Attr>namespace</a> is
6512
6513
<var> namespace</var> , <a for=Attr>namespace prefix</a> is <var> prefix</var> ,
6513
6514
<a for=Attr>local name</a> is <var> localName</var> and
6514
6515
<a for=Node>node document</a> is <var> element</var> 's <a for=Node>node document</a> .
6515
6516
6516
- <li><p> Set <a>attribute</a> 's <var> value</var> to the result of calling <a>Get Trusted Types-compliant attribute
6517
- value</a> for <var> attribute</var> , with <var> element</var> and
6518
- <var> value</var> . [[!TRUSTED-TYPES]]
6517
+ <li><p> <a>Validate and set attribute value</a> <var> value</var> for <var> attribute</var> with <var> element</var> .
6519
6518
6520
- <li><p> <a for=list>Append</a> <var> attribute</var> to <var> element</var> 's
6521
- <a for=Element>attribute list</a> .
6522
-
6523
- <li><p> Set <var> attribute</var> 's <a for=Attr>element</a> to <var> element</var> .
6524
-
6525
- <li><p> <a>Handle attribute changes</a> for <var> attribute</var> with <var> element</var> , null, and
6526
- <var> attribute</var> 's <a for=Attr>value</a> .
6527
- <li><p> Return.
6519
+ <li><p> <a lt="append an attribute">Append</a> <var> attribute</var> to <var> element</var>
6520
+ <li><p> Return.
6528
6521
</ol>
6529
6522
6530
6523
<li><p> <a lt="change an attribute">Change</a> <var> attribute</var> to <var> value</var> .
@@ -6788,10 +6781,14 @@ method steps are:
6788
6781
and null otherwise.
6789
6782
<!-- This is step 2 of "get an attribute by name", modified as appropriate -->
6790
6783
6791
- <li><p> If <var> attribute</var> is null, create an <a>attribute</a> whose
6792
- <a for=Attr>local name</a> is <var> qualifiedName</var> , <a for=Attr>value</a> is
6793
- stringified <var> value</var> , and <a for=Node>node document</a> is <a>this</a> 's <a for=Node>node document</a> ,
6794
- then <a lt="append an attribute">append</a> this <a>attribute</a> to <a>this</a> , and then return.
6784
+ <li><p> If <var> attribute</var> is null, then:
6785
+ <ol>
6786
+ <li><p> Set <var> attribute</var> to a new <a>attribute</a> whose
6787
+ <a for=Attr>local name</a> is <var> qualifiedName</var> and <a for=Node>node document</a> is <a>this</a> 's <a for=Node>node document</a> .
6788
+ <li><p> <a>Validate and set attribute value</a> <var> value</var> for <var> attribute</var> , with <a>this</a> .
6789
+ <li> <a lt="append an attribute">Append</a> <var> attribute</var> to <a>this</a> .
6790
+ <li><p> Return.
6791
+ </ol>
6795
6792
6796
6793
<li><p> <a lt="change an attribute">Change</a> <var> attribute</var> to <var> value</var> .
6797
6794
</ol>
0 commit comments