@@ -52,9 +52,10 @@ spec:html; type:element
52
52
<p> This specification depends on the Infra Standard. [[!INFRA]]
53
53
54
54
<p> Some of the terms used in this specification are defined in <cite> Encoding</cite> ,
55
- <cite> Selectors</cite> , <cite> Web IDL</cite> , <cite> XML</cite> , and <cite> Namespaces in XML</cite> .
55
+ <cite> Selectors</cite> , <cite> Trusted Types </cite> , <cite> Web IDL</cite> , <cite> XML</cite> , and <cite> Namespaces in XML</cite> .
56
56
[[!ENCODING]]
57
57
[[!SELECTORS4]]
58
+ [[!TRUSTED-TYPES]]
58
59
[[!WEBIDL]]
59
60
[[!XML]]
60
61
[[!XML-NAMES]]
@@ -6048,8 +6049,8 @@ interface Element : Node {
6048
6049
sequence<DOMString> getAttributeNames();
6049
6050
DOMString? getAttribute(DOMString qualifiedName);
6050
6051
DOMString? getAttributeNS(DOMString? namespace, DOMString localName);
6051
- [CEReactions] undefined setAttribute(DOMString qualifiedName, DOMString value);
6052
- [CEReactions] undefined setAttributeNS(DOMString? namespace, DOMString qualifiedName, DOMString value);
6052
+ [CEReactions] undefined setAttribute(DOMString qualifiedName, (TrustedType or DOMString) value);
6053
+ [CEReactions] undefined setAttributeNS(DOMString? namespace, DOMString qualifiedName, (TrustedType or DOMString) value);
6053
6054
[CEReactions] undefined removeAttribute(DOMString qualifiedName);
6054
6055
[CEReactions] undefined removeAttributeNS(DOMString? namespace, DOMString localName);
6055
6056
[CEReactions] boolean toggleAttribute(DOMString qualifiedName, optional boolean force);
@@ -6371,6 +6372,10 @@ given a <var>document</var>, <var>localName</var>, <var>namespace</var>, and opt
6371
6372
<a>attribute</a> <var> attribute</var> to <var> value</var> , run these steps:
6372
6373
6373
6374
<ol>
6375
+ <li><p> Set <var> value</var> to the result of calling <a>Get Trusted Types-compliant attribute
6376
+ value</a> for <var> attribute</var> , with <var> attribute</var> 's <a for=Attr>element</a> and
6377
+ <var> value</var> . [[!TRUSTED-TYPES]]
6378
+
6374
6379
<li><p> Let <var> oldValue</var> be <var> attribute</var> 's <a for=Attr>value</a> .</p></li>
6375
6380
6376
6381
<li><p> Set <var> attribute</var> 's <a for=Attr>value</a> to <var> value</var> .
@@ -6384,6 +6389,11 @@ given a <var>document</var>, <var>localName</var>, <var>namespace</var>, and opt
6384
6389
steps:
6385
6390
6386
6391
<ol>
6392
+ <li><p> Set <var> attribute</var> 's
6393
+ <a for=Attr>value</a> to the result of calling <a>Get Trusted Types-compliant attribute value</a>
6394
+ for <var> attribute</var> , with <var> element</var> and <var> attribute</var> 's <a for=Attr>value</a> .
6395
+ [[!TRUSTED-TYPES]]
6396
+
6387
6397
<li><p> <a for=list>Append</a> <var> attribute</var> to <var> element</var> 's
6388
6398
<a for=Element>attribute list</a> .
6389
6399
@@ -6412,6 +6422,11 @@ steps:
6412
6422
<a>attribute</a> <var> oldAttr</var> with an <a>attribute</a> <var> newAttr</var> , run these steps:
6413
6423
6414
6424
<ol>
6425
+ <li><p> Set <var> newAttr</var> 's
6426
+ <a for=Attr>value</a> to the result of calling <a>Get Trusted Types-compliant attribute value</a>
6427
+ for <var> newAttr</var> , with <var> oldAttr</var> 's <a for=Attr>element</a> and <var>newAttr</var>' s
6428
+ <a for=Attr>value</a> .[[!TRUSTED-TYPES]]
6429
+
6415
6430
<li><p> <a for=list>Replace</a> <var> oldAttr</var> by <var> newAttr</var> in <var> oldAttr</var> 's
6416
6431
<a for=Attr>element</a> 's <a for=Element>attribute list</a> .
6417
6432
@@ -6498,7 +6513,7 @@ string <var>namespace</var> (default null):</p>
6498
6513
6499
6514
<div algorithm>
6500
6515
<p> To <dfn export id=concept-element-attributes-set-value>set an attribute value</dfn> given an
6501
- <a for=/>element</a> <var> element</var> , a string <var> localName</var> , a string <var> value</var> ,
6516
+ <a for=/>element</a> <var> element</var> , a string <var> localName</var> , a string or <a>TrustedType</a> <var> value</var> ,
6502
6517
an optional null or string <var> prefix</var> (default null), and an optional null or string
6503
6518
<var> namespace</var> (default null):
6504
6519
@@ -6509,7 +6524,7 @@ an optional null or string <var>prefix</var> (default null), and an optional nul
6509
6524
6510
6525
<li> If <var> attribute</var> is null, create an <a>attribute</a> whose <a for=Attr>namespace</a> is
6511
6526
<var> namespace</var> , <a for=Attr>namespace prefix</a> is <var> prefix</var> ,
6512
- <a for=Attr>local name</a> is <var> localName</var> , <a for=Attr>value</a> is <var> value</var> , and
6527
+ <a for=Attr>local name</a> is <var> localName</var> , <a for=Attr>value</a> is stringified <var> value</var> , and
6513
6528
<a for=Node>node document</a> is <var> element</var> 's <a for=Node>node document</a> , then
6514
6529
<a lt="append an attribute">append</a> this <a>attribute</a> to <var> element</var> , and then
6515
6530
return.
@@ -6777,7 +6792,7 @@ method steps are:
6777
6792
6778
6793
<li><p> If <var> attribute</var> is null, create an <a>attribute</a> whose
6779
6794
<a for=Attr>local name</a> is <var> qualifiedName</var> , <a for=Attr>value</a> is
6780
- <var> value</var> , and <a for=Node>node document</a> is <a>this</a> 's <a for=Node>node document</a> ,
6795
+ stringified <var> value</var> , and <a for=Node>node document</a> is <a>this</a> 's <a for=Node>node document</a> ,
6781
6796
then <a lt="append an attribute">append</a> this <a>attribute</a> to <a>this</a> , and then return.
6782
6797
6783
6798
<li><p> <a lt="change an attribute">Change</a> <var> attribute</var> to <var> value</var> .
0 commit comments