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