@@ -4281,7 +4281,7 @@ empty string instead, and then do as described below, switching on the interface
42814281
42824282<dl class=switch>
42834283 <dt> {{Attr}}
4284- <dd><p> <a>Set an existing attribute value</a> with <a>this</a> , the given value, and "Node nodeValue" .
4284+ <dd><p> <a>Set an existing attribute value</a> with <a>this</a> , the given value.
42854285
42864286 <dt> {{CharacterData}}
42874287 <dd><p> <a>Replace data</a> with node <a>this</a> , offset 0, count <a>this</a> 's
@@ -4334,8 +4334,7 @@ do as defined below, switching on the interface <var>node</var> <a>implements</a
43344334 <dd><p> <a>String replace all</a> with <var> value</var> within <var> node</var> .
43354335
43364336 <dt> {{Attr}}
4337- <dd><p> <a>Set an existing attribute value</a> with <var> node</var> , <var> value</var> and
4338- "Node textContent".
4337+ <dd><p> <a>Set an existing attribute value</a> with <var> node</var> , <var> value</var> .
43394338
43404339 <dt> {{CharacterData}}
43414340 <dd><p> <a>Replace data</a> with node <var> node</var> , offset 0, count <var> node</var> 's
@@ -4458,7 +4457,8 @@ dom-Range-extractContents, dom-Range-cloneContents -->
44584457 <ol>
44594458 <li><p> Let <var> copyAttribute</var> be a <a>clone</a> of <var> attribute</var> .
44604459
4461- <li><p> <a lt="append an attribute">Append</a> <var> copyAttribute</var> to <var> copy</var> .
4460+ <li><p> <a lt="append an attribute">Append</a> <var> copyAttribute</var> to <var> copy</var> ,
4461+ with false.
44624462 </ol>
44634463 </li>
44644464 </ol>
@@ -6371,26 +6371,36 @@ given a <var>document</var>, <var>localName</var>, <var>namespace</var>, and opt
63716371</ol>
63726372
63736373<p> To <dfn export id=concept-element-attributes-change lt="change an attribute">change</dfn> an
6374- <a>attribute</a> <var> attribute</var> to <var> value</var> , with string <var> sink </var> , run these steps:
6374+ <a>attribute</a> <var> attribute</var> to <var> value</var> , run these steps:
63756375
63766376<ol>
63776377 <li><p> Let <var> oldValue</var> be <var> attribute</var> 's <a for=Attr>value</a> .</p></li>
63786378
63796379 <li><p> <a>Validate and set attribute value</a> <var> value</var> for <var> attribute</var> , with
6380- <var> attribute</var> 's <a for=Attr>element</a> , and <var> sink </var> .
6380+ <var> attribute</var> 's <a for=Attr>element</a> .
63816381
6382- <li><p> <a>Handle attribute changes</a> for <var> attribute</var> with <var> attribute</var> 's
6383- <a for=Attr>element</a> , <var> oldValue</var> , and <var> value</var> .
6382+ <li><p> If <var> attribute</var> 's <a for=Attr>element</a> <a lt="has an attribute">has</a>
6383+ an <a>attribute</a> <var> attribute</var> , then <a>handle attribute changes</a> for
6384+ <var> attribute</var> with <var> attribute</var> 's <a for=Attr>element</a> , <var> oldValue</var> , and
6385+ <var> value</var> .
6386+
6387+ <li><p> Otherwise, throw an "{{InvalidStateError!!exception}} " {{DOMException}} .
63846388</ol>
63856389
63866390<p> To <dfn export id=concept-element-attributes-append lt="append an attribute">append</dfn> an
63876391<a>attribute</a> <var> attribute</var> to an <a for=/>element</a> <var> element</var> , with optional
6388- string <var> sink </var> (default "" ), run these steps:
6392+ boolean <var> validate </var> (default true ), run these steps:
63896393
63906394<ol>
6391- <li><p> If <var> sink</var> is not an empty string <a>Validate and set attribute value</a>
6392- <var> attribute</var> 's <a for="Attr">value</a> for <var> attribute</var> with <var> element</var> ,
6393- and <var> sink</var> .
6395+ <li>
6396+ <p> If <var> validate</var> , then:
6397+ <ol>
6398+ <li><p> <a>Validate and set attribute value</a>
6399+ <var> attribute</var> 's <a for="Attr">value</a> for <var> attribute</var> with <var> element</var> .
6400+
6401+ <li><p> If <var> element</var> <a lt="has an attribute">has</a> an <a>attribute</a>
6402+ <var> attribute</var> , then throw an "{{InvalidStateError!!exception}} " {{DOMException}} .
6403+ </ol>
63946404
63956405 <li><p> <a for=list>Append</a> <var> attribute</var> to <var> element</var> 's
63966406 <a for=Element>attribute list</a> .
@@ -6435,12 +6445,12 @@ string <var>sink</var> (default ""), run these steps:
64356445
64366446<p> To <dfn id=concept-element-attributes-validate-and-set-value>validate and set attribute value</dfn>
64376447{{TrustedType}} or a string <var> value</var> for an <a>attribute</a> <var> attribute</var> , with
6438- <a for=/>element</a> <var> element</var> , and string <var> sink </var> :
6448+ <a for=/>element</a> <var> element</var> :
64396449
64406450<ol>
64416451 <li><p> Let <var> validValue</var> be the result of calling
64426452 <a abstract-op>get Trusted Types-compliant attribute value</a> for <var> attribute</var> , with
6443- <var> element</var> , <var> value</var> , and <var> sink </var> . [[!TRUSTED-TYPES]]
6453+ <var> element</var> , <var> value</var> . [[!TRUSTED-TYPES]]
64446454
64456455 <li><p> Set <var> attribute</var> 's <a for=Attr>value</a> to <var> validValue</var> .
64466456</ol>
@@ -6494,8 +6504,7 @@ string <var>namespace</var> (default null):</p>
64946504
64956505<div algorithm>
64966506<p> To <dfn export id=concept-element-attributes-set>set an attribute</dfn> given an
6497- <a for=/>attribute</a> <var> attr</var> , an <a for=/>element</a> <var> element</var> ,
6498- and a string <var> sink</var> :
6507+ <a for=/>attribute</a> <var> attr</var> , an <a for=/>element</a> <var> element</var> .
64996508
65006509<ol>
65016510 <li><p> If <var> attr</var> 's <a for=Attr>element</a> is neither null nor <var> element</var> ,
@@ -6513,13 +6522,16 @@ and a string <var>sink</var>:
65136522
65146523 <ul>
65156524 <li><p> <a>Validate and set attribute value</a> <var> attr</var> 's <a for="Attr">value</a> for
6516- <var> attr</var> with <var> element</var> , and <var> sink</var> .
6525+ <var> attr</var> with <var> element</var> .
6526+
6527+ <li><p> If <var> element</var> <a lt="has an attribute">has</a> an <a>attribute</a>
6528+ <var> attr</var> , then <a lt="replace an attribute">replace</a> <var> oldAttr</var> with
6529+ <var> attr</var> .
65176530
6518- <li><p> <a lt="replace an attribute">Replace</a> <var> oldAttr </var> with <var> attr </var> .
6531+ <li><p> Otherwise, throw an " {{InvalidStateError!!exception}} " {{DOMException}} .
65196532 </ul>
65206533
6521- <li><p> Otherwise, <a lt="append an attribute">append</a> <var> attr</var> to <var> element</var>
6522- with <var> sink</var> .
6534+ <li><p> Otherwise, <a lt="append an attribute">append</a> <var> attr</var> to <var> element</var> .
65236535
65246536 <li><p> Return <var> oldAttr</var> .
65256537</ol>
@@ -6529,7 +6541,7 @@ and a string <var>sink</var>:
65296541<p> To <dfn export id=concept-element-attributes-set-value>set an attribute value</dfn> given an
65306542<a for=/>element</a> <var> element</var> , a string <var> localName</var> , a string or {{TrustedType}}
65316543<var> value</var> , an optional null or string <var> prefix</var> (default null), an optional null
6532- or string <var> namespace</var> (default null), and an optional string <var> sink </var> (default "") :
6544+ or string <var> namespace</var> (default null):
65336545
65346546<ol>
65356547 <li> Let <var> attribute</var> be the result of
@@ -6540,10 +6552,9 @@ or string <var>namespace</var> (default null), and an optional string <var>sink<
65406552 <var> namespace</var> , <a for=Attr>namespace prefix</a> is <var> prefix</var> ,
65416553 <a for=Attr>local name</a> is <var> localName</var> , <a for=Attr>value</a> is <var> value</var> , and
65426554 <a for=Node>node document</a> is <var> element</var> 's <a for=Node>node document</a> , then
6543- <a lt="append an attribute">append</a> this <a>attribute</a> to <var> element</var> with
6544- <var> sink</var> , and then return.
6555+ <a lt="append an attribute">append</a> this <a>attribute</a> to <var> element</var> , and then return.
65456556
6546- <li><p> <a lt="change an attribute">Change</a> <var> attribute</var> to <var> value</var> , with <var> sink </var> .
6557+ <li><p> <a lt="change an attribute">Change</a> <var> attribute</var> to <var> value</var> .
65476558</ol>
65486559</div>
65496560
@@ -6804,13 +6815,12 @@ method steps are:
68046815 and null otherwise.
68056816 <!-- This is step 2 of "get an attribute by name", modified as appropriate -->
68066817
6807- <li><p> If <var> attribute</var> is null, create an <a>attribute</a> whose
6808- <a for=Attr>local name</a> is <var> qualifiedName</var> , <a for=Attr>value</a> is
6809- <var> value</var> , and <a for=Node>node document</a> is <a>this</a> 's <a for=Node>node document</a> ,
6810- then <a lt="append an attribute">append</a> this <a>attribute</a> to <a>this</a> with
6811- "Element setAttribute", and then return.
6818+ <li><p> If <var> attribute</var> is null, create an <a>attribute</a> whose
6819+ <a for=Attr>local name</a> is <var> qualifiedName</var> , <a for=Attr>value</a> is
6820+ <var> value</var> , and <a for=Node>node document</a> is <a>this</a> 's <a for=Node>node document</a> ,
6821+ then <a lt="append an attribute">append</a> this <a>attribute</a> to <a>this</a> , and then return.
68126822
6813- <li><p> <a lt="change an attribute">Change</a> <var> attribute</var> to <var> value</var> , with "Element setAttribute" .
6823+ <li><p> <a lt="change an attribute">Change</a> <var> attribute</var> to <var> value</var> .
68146824</ol>
68156825
68166826<p> The
@@ -6822,7 +6832,7 @@ method steps are:
68226832 passing <var> namespace</var> and <var> qualifiedName</var> to <a>validate and extract</a> .
68236833
68246834 <li><p> <a>Set an attribute value</a> for <a>this</a> using <var> localName</var> , <var> value</var> ,
6825- and also <var> prefix</var> and <var> namespace</var> , and "Element setAttributeNS" .
6835+ and also <var> prefix</var> and <var> namespace</var> .
68266836</ol>
68276837
68286838<p> The
@@ -6871,8 +6881,8 @@ method steps are:
68716881 <li><p> If <var> force</var> is not given or is true, create an <a>attribute</a> whose
68726882 <a for=Attr>local name</a> is <var> qualifiedName</var> , <a for=Attr>value</a> is the empty
68736883 string, and <a for=Node>node document</a> is <a>this</a> 's <a for=Node>node document</a> , then
6874- <a lt="append an attribute">append</a> this <a>attribute</a> to <a>this</a> with
6875- "Element toggleAttribute", and then return true.
6884+ <a lt="append an attribute">append</a> this <a>attribute</a> to <a>this</a> ,
6885+ and then return true.
68766886
68776887 <li><p> Return false.
68786888 </ol>
@@ -6910,11 +6920,11 @@ method steps are to return the result of
69106920
69116921<p> The <dfn method for=Element><code>setAttributeNode(<var>attr</var>)</code></dfn> methods steps are to
69126922return the result of <a lt="set an attribute">setting an attribute</a> given <var> attr</var> and
6913- <a>this</a> , and "Element setAttributeNode" .
6923+ <a>this</a> .
69146924
69156925<p> The <dfn method for=Element><code>setAttributeNodeNS(<var>attr</var>)</code></dfn> methods steps are to
69166926return the result of <a lt="set an attribute">setting an attribute</a> given <var> attr</var> ,
6917- <a>this</a> , and "Element setAttributeNodeNS" .
6927+ <a>this</a> .
69186928
69196929<p> The <dfn method for=Element><code>removeAttributeNode(<var>attr</var>)</code></dfn> method steps
69206930are:
@@ -7271,11 +7281,11 @@ method steps are to return the result of
72717281
72727282<p> The <dfn method for=NamedNodeMap><code>setNamedItem(<var>attr</var>)</code></dfn> method steps are
72737283to return the result of <a lt="set an attribute">setting an attribute</a> given <var> attr</var> ,
7274- <a for=NamedNodeMap>element</a> , and "NamedNodeMap setNamedItem" .
7284+ <a for=NamedNodeMap>element</a> .
72757285
72767286<p> The <dfn method for=NamedNodeMap><code>setNamedItemNS(<var>attr</var>)</code></dfn> method steps are
72777287to return the result of <a lt="set an attribute">setting an attribute</a> given <var> attr</var> ,
7278- <a for=NamedNodeMap>element</a> , and "NamedNodeMap setNamedItemNS" .
7288+ <a for=NamedNodeMap>element</a> .
72797289
72807290<p> The <dfn method for=NamedNodeMap><code>removeNamedItem(<var>qualifiedName</var>)</code></dfn>
72817291method steps are:
@@ -7380,14 +7390,13 @@ null.
73807390<a for=Attr>value</a> .
73817391
73827392<p> To <dfn>set an existing attribute value</dfn> , given an <a>attribute</a> <var> attribute</var> ,
7383- string <var> value</var> , and string <var> sink </var> , run these steps:
7393+ string <var> value</var> , run these steps:
73847394
73857395<ol>
73867396 <li><p> If <var> attribute</var> 's <a for=Attr>element</a> is null, then set <var>attribute</var>' s
73877397 <a for=Attr>value</a> to <var> value</var> .
73887398
7389- <li><p> Otherwise, <a lt="change an attribute">change</a> <var> attribute</var> to <var> value</var> ,
7390- with <var> sink</var> .
7399+ <li><p> Otherwise, <a lt="change an attribute">change</a> <var> attribute</var> to <var> value</var> .
73917400</ol>
73927401
73937402<p> The {{Attr/value}} setter steps are to <a>set an existing attribute value</a> with <a>this</a> ,
0 commit comments