@@ -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]]
@@ -6032,8 +6033,8 @@ interface Element : Node {
6032
6033
sequence<DOMString> getAttributeNames();
6033
6034
DOMString? getAttribute(DOMString qualifiedName);
6034
6035
DOMString? getAttributeNS(DOMString? namespace, DOMString localName);
6035
- [CEReactions] undefined setAttribute(DOMString qualifiedName, DOMString value);
6036
- [CEReactions] undefined setAttributeNS(DOMString? namespace, DOMString qualifiedName, DOMString value);
6036
+ [CEReactions] undefined setAttribute(DOMString qualifiedName, (TrustedType or DOMString) value);
6037
+ [CEReactions] undefined setAttributeNS(DOMString? namespace, DOMString qualifiedName, (TrustedType or DOMString) value);
6037
6038
[CEReactions] undefined removeAttribute(DOMString qualifiedName);
6038
6039
[CEReactions] undefined removeAttributeNS(DOMString? namespace, DOMString localName);
6039
6040
[CEReactions] boolean toggleAttribute(DOMString qualifiedName, optional boolean force);
@@ -6354,6 +6355,10 @@ given a <var>document</var>, <var>localName</var>, <var>namespace</var>, and opt
6354
6355
<a>attribute</a> <var> attribute</var> to <var> value</var> , run these steps:
6355
6356
6356
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
+
6357
6362
<li><p> Let <var> oldValue</var> be <var> attribute</var> 's <a for=Attr>value</a> .</p></li>
6358
6363
6359
6364
<li><p> Set <var> attribute</var> 's <a for=Attr>value</a> to <var> value</var> .
@@ -6367,6 +6372,11 @@ given a <var>document</var>, <var>localName</var>, <var>namespace</var>, and opt
6367
6372
steps:
6368
6373
6369
6374
<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
+
6370
6380
<li><p> <a for=list>Append</a> <var> attribute</var> to <var> element</var> 's
6371
6381
<a for=Element>attribute list</a> .
6372
6382
@@ -6395,6 +6405,11 @@ steps:
6395
6405
<a>attribute</a> <var> oldAttr</var> with an <a>attribute</a> <var> newAttr</var> , run these steps:
6396
6406
6397
6407
<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
+
6398
6413
<li><p> <a for=list>Replace</a> <var> oldAttr</var> by <var> newAttr</var> in <var> oldAttr</var> 's
6399
6414
<a for=Attr>element</a> 's <a for=Element>attribute list</a> .
6400
6415
@@ -6481,7 +6496,7 @@ string <var>namespace</var> (default null):</p>
6481
6496
6482
6497
<div algorithm>
6483
6498
<p> To <dfn export id=concept-element-attributes-set-value>set an attribute value</dfn> given an
6484
- <a for=/>element</a> <var> element</var> , a string <var> localName</var> , a string <var> value</var> ,
6499
+ <a for=/>element</a> <var> element</var> , a string <var> localName</var> , a string or <a>TrustedType</a> <var> value</var> ,
6485
6500
an optional null or string <var> prefix</var> (default null), and an optional null or string
6486
6501
<var> namespace</var> (default null):
6487
6502
@@ -6492,7 +6507,7 @@ an optional null or string <var>prefix</var> (default null), and an optional nul
6492
6507
6493
6508
<li> If <var> attribute</var> is null, create an <a>attribute</a> whose <a for=Attr>namespace</a> is
6494
6509
<var> namespace</var> , <a for=Attr>namespace prefix</a> is <var> prefix</var> ,
6495
- <a for=Attr>local name</a> is <var> localName</var> , <a for=Attr>value</a> is <var> value</var> , and
6510
+ <a for=Attr>local name</a> is <var> localName</var> , <a for=Attr>value</a> is stringified <var> value</var> , and
6496
6511
<a for=Node>node document</a> is <var> element</var> 's <a for=Node>node document</a> , then
6497
6512
<a lt="append an attribute">append</a> this <a>attribute</a> to <var> element</var> , and then
6498
6513
return.
@@ -6760,7 +6775,7 @@ method steps are:
6760
6775
6761
6776
<li><p> If <var> attribute</var> is null, create an <a>attribute</a> whose
6762
6777
<a for=Attr>local name</a> is <var> qualifiedName</var> , <a for=Attr>value</a> is
6763
- <var> value</var> , and <a for=Node>node document</a> is <a>this</a> 's <a for=Node>node document</a> ,
6778
+ stringified <var> value</var> , and <a for=Node>node document</a> is <a>this</a> 's <a for=Node>node document</a> ,
6764
6779
then <a lt="append an attribute">append</a> this <a>attribute</a> to <a>this</a> , and then return.
6765
6780
6766
6781
<li><p> <a lt="change an attribute">Change</a> <var> attribute</var> to <var> value</var> .
0 commit comments