@@ -4278,7 +4278,7 @@ empty string instead, and then do as described below, switching on the interface
42784278
42794279<dl class=switch>
42804280 <dt> {{Attr}}
4281- <dd><p> <a>Set an existing attribute value</a> with <a>this</a> , the given value, and "Node nodeValue" .
4281+ <dd><p> <a>Set an existing attribute value</a> with <a>this</a> , the given value.
42824282
42834283 <dt> {{CharacterData}}
42844284 <dd><p> <a>Replace data</a> with node <a>this</a> , offset 0, count <a>this</a> 's
@@ -4331,8 +4331,7 @@ do as defined below, switching on the interface <var>node</var> <a>implements</a
43314331 <dd><p> <a>String replace all</a> with <var> value</var> within <var> node</var> .
43324332
43334333 <dt> {{Attr}}
4334- <dd><p> <a>Set an existing attribute value</a> with <var> node</var> , <var> value</var> and
4335- "Node textContent".
4334+ <dd><p> <a>Set an existing attribute value</a> with <var> node</var> , <var> value</var> .
43364335
43374336 <dt> {{CharacterData}}
43384337 <dd><p> <a>Replace data</a> with node <var> node</var> , offset 0, count <var> node</var> 's
@@ -4455,7 +4454,8 @@ dom-Range-extractContents, dom-Range-cloneContents -->
44554454 <ol>
44564455 <li><p> Let <var> copyAttribute</var> be a <a>clone</a> of <var> attribute</var> .
44574456
4458- <li><p> <a lt="append an attribute">Append</a> <var> copyAttribute</var> to <var> copy</var> .
4457+ <li><p> <a lt="append an attribute">Append</a> <var> copyAttribute</var> to <var> copy</var> ,
4458+ with false.
44594459 </ol>
44604460 </li>
44614461 </ol>
@@ -6368,26 +6368,36 @@ given a <var>document</var>, <var>localName</var>, <var>namespace</var>, and opt
63686368</ol>
63696369
63706370<p> To <dfn export id=concept-element-attributes-change lt="change an attribute">change</dfn> an
6371- <a>attribute</a> <var> attribute</var> to <var> value</var> , with string <var> sink </var> , run these steps:
6371+ <a>attribute</a> <var> attribute</var> to <var> value</var> , run these steps:
63726372
63736373<ol>
63746374 <li><p> Let <var> oldValue</var> be <var> attribute</var> 's <a for=Attr>value</a> .</p></li>
63756375
63766376 <li><p> <a>Validate and set attribute value</a> <var> value</var> for <var> attribute</var> , with
6377- <var> attribute</var> 's <a for=Attr>element</a> , and <var> sink </var> .
6377+ <var> attribute</var> 's <a for=Attr>element</a> .
63786378
6379- <li><p> <a>Handle attribute changes</a> for <var> attribute</var> with <var> attribute</var> 's
6380- <a for=Attr>element</a> , <var> oldValue</var> , and <var> value</var> .
6379+ <li><p> If <var> attribute</var> 's <a for=Attr>element</a> <a lt="has an attribute">has</a>
6380+ an <a>attribute</a> <var> attribute</var> , then <a>handle attribute changes</a> for
6381+ <var> attribute</var> with <var> attribute</var> 's <a for=Attr>element</a> , <var> oldValue</var> , and
6382+ <var> value</var> .
6383+
6384+ <li><p> Otherwise, throw an "{{InvalidStateError!!exception}} " {{DOMException}} .
63816385</ol>
63826386
63836387<p> To <dfn export id=concept-element-attributes-append lt="append an attribute">append</dfn> an
63846388<a>attribute</a> <var> attribute</var> to an <a for=/>element</a> <var> element</var> , with optional
6385- string <var> sink </var> (default "" ), run these steps:
6389+ boolean <var> validate </var> (default true ), run these steps:
63866390
63876391<ol>
6388- <li><p> If <var> sink</var> is not an empty string <a>Validate and set attribute value</a>
6389- <var> attribute</var> 's <a for="Attr">value</a> for <var> attribute</var> with <var> element</var> ,
6390- and <var> sink</var> .
6392+ <li>
6393+ <p> If <var> validate</var> , then:
6394+ <ol>
6395+ <li><p> <a>Validate and set attribute value</a>
6396+ <var> attribute</var> 's <a for="Attr">value</a> for <var> attribute</var> with <var> element</var> .
6397+
6398+ <li><p> If <var> element</var> <a lt="has an attribute">has</a> an <a>attribute</a>
6399+ <var> attribute</var> , then throw an "{{InvalidStateError!!exception}} " {{DOMException}} .
6400+ </ol>
63916401
63926402 <li><p> <a for=list>Append</a> <var> attribute</var> to <var> element</var> 's
63936403 <a for=Element>attribute list</a> .
@@ -6432,12 +6442,12 @@ string <var>sink</var> (default ""), run these steps:
64326442
64336443<p> To <dfn id=concept-element-attributes-validate-and-set-value>validate and set attribute value</dfn>
64346444{{TrustedType}} or a string <var> value</var> for an <a>attribute</a> <var> attribute</var> , with
6435- <a for=/>element</a> <var> element</var> , and string <var> sink </var> :
6445+ <a for=/>element</a> <var> element</var> :
64366446
64376447<ol>
64386448 <li><p> Let <var> validValue</var> be the result of calling
64396449 <a abstract-op>get Trusted Types-compliant attribute value</a> for <var> attribute</var> , with
6440- <var> element</var> , <var> value</var> , and <var> sink </var> . [[!TRUSTED-TYPES]]
6450+ <var> element</var> , <var> value</var> . [[!TRUSTED-TYPES]]
64416451
64426452 <li><p> Set <var> attribute</var> 's <a for=Attr>value</a> to <var> validValue</var> .
64436453</ol>
@@ -6491,8 +6501,7 @@ string <var>namespace</var> (default null):</p>
64916501
64926502<div algorithm>
64936503<p> To <dfn export id=concept-element-attributes-set>set an attribute</dfn> given an
6494- <a for=/>attribute</a> <var> attr</var> , an <a for=/>element</a> <var> element</var> ,
6495- and a string <var> sink</var> :
6504+ <a for=/>attribute</a> <var> attr</var> , an <a for=/>element</a> <var> element</var> .
64966505
64976506<ol>
64986507 <li><p> If <var> attr</var> 's <a for=Attr>element</a> is neither null nor <var> element</var> ,
@@ -6510,13 +6519,16 @@ and a string <var>sink</var>:
65106519
65116520 <ul>
65126521 <li><p> <a>Validate and set attribute value</a> <var> attr</var> 's <a for="Attr">value</a> for
6513- <var> attr</var> with <var> element</var> , and <var> sink</var> .
6522+ <var> attr</var> with <var> element</var> .
6523+
6524+ <li><p> If <var> element</var> <a lt="has an attribute">has</a> an <a>attribute</a>
6525+ <var> attr</var> , then <a lt="replace an attribute">replace</a> <var> oldAttr</var> with
6526+ <var> attr</var> .
65146527
6515- <li><p> <a lt="replace an attribute">Replace</a> <var> oldAttr </var> with <var> attr </var> .
6528+ <li><p> Otherwise, throw an " {{InvalidStateError!!exception}} " {{DOMException}} .
65166529 </ul>
65176530
6518- <li><p> Otherwise, <a lt="append an attribute">append</a> <var> attr</var> to <var> element</var>
6519- with <var> sink</var> .
6531+ <li><p> Otherwise, <a lt="append an attribute">append</a> <var> attr</var> to <var> element</var> .
65206532
65216533 <li><p> Return <var> oldAttr</var> .
65226534</ol>
@@ -6526,7 +6538,7 @@ and a string <var>sink</var>:
65266538<p> To <dfn export id=concept-element-attributes-set-value>set an attribute value</dfn> given an
65276539<a for=/>element</a> <var> element</var> , a string <var> localName</var> , a string or {{TrustedType}}
65286540<var> value</var> , an optional null or string <var> prefix</var> (default null), an optional null
6529- or string <var> namespace</var> (default null), and an optional string <var> sink </var> (default "") :
6541+ or string <var> namespace</var> (default null):
65306542
65316543<ol>
65326544 <li> Let <var> attribute</var> be the result of
@@ -6537,10 +6549,9 @@ or string <var>namespace</var> (default null), and an optional string <var>sink<
65376549 <var> namespace</var> , <a for=Attr>namespace prefix</a> is <var> prefix</var> ,
65386550 <a for=Attr>local name</a> is <var> localName</var> , <a for=Attr>value</a> is <var> value</var> , and
65396551 <a for=Node>node document</a> is <var> element</var> 's <a for=Node>node document</a> , then
6540- <a lt="append an attribute">append</a> this <a>attribute</a> to <var> element</var> with
6541- <var> sink</var> , and then return.
6552+ <a lt="append an attribute">append</a> this <a>attribute</a> to <var> element</var> , and then return.
65426553
6543- <li><p> <a lt="change an attribute">Change</a> <var> attribute</var> to <var> value</var> , with <var> sink </var> .
6554+ <li><p> <a lt="change an attribute">Change</a> <var> attribute</var> to <var> value</var> .
65446555</ol>
65456556</div>
65466557
@@ -6801,13 +6812,12 @@ method steps are:
68016812 and null otherwise.
68026813 <!-- This is step 2 of "get an attribute by name", modified as appropriate -->
68036814
6804- <li><p> If <var> attribute</var> is null, create an <a>attribute</a> whose
6805- <a for=Attr>local name</a> is <var> qualifiedName</var> , <a for=Attr>value</a> is
6806- <var> value</var> , and <a for=Node>node document</a> is <a>this</a> 's <a for=Node>node document</a> ,
6807- then <a lt="append an attribute">append</a> this <a>attribute</a> to <a>this</a> with
6808- "Element setAttribute", and then return.
6815+ <li><p> If <var> attribute</var> is null, create an <a>attribute</a> whose
6816+ <a for=Attr>local name</a> is <var> qualifiedName</var> , <a for=Attr>value</a> is
6817+ <var> value</var> , and <a for=Node>node document</a> is <a>this</a> 's <a for=Node>node document</a> ,
6818+ then <a lt="append an attribute">append</a> this <a>attribute</a> to <a>this</a> , and then return.
68096819
6810- <li><p> <a lt="change an attribute">Change</a> <var> attribute</var> to <var> value</var> , with "Element setAttribute" .
6820+ <li><p> <a lt="change an attribute">Change</a> <var> attribute</var> to <var> value</var> .
68116821</ol>
68126822
68136823<p> The
@@ -6819,7 +6829,7 @@ method steps are:
68196829 passing <var> namespace</var> and <var> qualifiedName</var> to <a>validate and extract</a> .
68206830
68216831 <li><p> <a>Set an attribute value</a> for <a>this</a> using <var> localName</var> , <var> value</var> ,
6822- and also <var> prefix</var> and <var> namespace</var> , and "Element setAttributeNS" .
6832+ and also <var> prefix</var> and <var> namespace</var> .
68236833</ol>
68246834
68256835<p> The
@@ -6868,8 +6878,8 @@ method steps are:
68686878 <li><p> If <var> force</var> is not given or is true, create an <a>attribute</a> whose
68696879 <a for=Attr>local name</a> is <var> qualifiedName</var> , <a for=Attr>value</a> is the empty
68706880 string, and <a for=Node>node document</a> is <a>this</a> 's <a for=Node>node document</a> , then
6871- <a lt="append an attribute">append</a> this <a>attribute</a> to <a>this</a> with
6872- "Element toggleAttribute", and then return true.
6881+ <a lt="append an attribute">append</a> this <a>attribute</a> to <a>this</a> ,
6882+ and then return true.
68736883
68746884 <li><p> Return false.
68756885 </ol>
@@ -6907,11 +6917,11 @@ method steps are to return the result of
69076917
69086918<p> The <dfn method for=Element><code>setAttributeNode(<var>attr</var>)</code></dfn> methods steps are to
69096919return the result of <a lt="set an attribute">setting an attribute</a> given <var> attr</var> and
6910- <a>this</a> , and "Element setAttributeNode" .
6920+ <a>this</a> .
69116921
69126922<p> The <dfn method for=Element><code>setAttributeNodeNS(<var>attr</var>)</code></dfn> methods steps are to
69136923return the result of <a lt="set an attribute">setting an attribute</a> given <var> attr</var> ,
6914- <a>this</a> , and "Element setAttributeNodeNS" .
6924+ <a>this</a> .
69156925
69166926<p> The <dfn method for=Element><code>removeAttributeNode(<var>attr</var>)</code></dfn> method steps
69176927are:
@@ -7268,11 +7278,11 @@ method steps are to return the result of
72687278
72697279<p> The <dfn method for=NamedNodeMap><code>setNamedItem(<var>attr</var>)</code></dfn> method steps are
72707280to return the result of <a lt="set an attribute">setting an attribute</a> given <var> attr</var> ,
7271- <a for=NamedNodeMap>element</a> , and "NamedNodeMap setNamedItem" .
7281+ <a for=NamedNodeMap>element</a> .
72727282
72737283<p> The <dfn method for=NamedNodeMap><code>setNamedItemNS(<var>attr</var>)</code></dfn> method steps are
72747284to return the result of <a lt="set an attribute">setting an attribute</a> given <var> attr</var> ,
7275- <a for=NamedNodeMap>element</a> , and "NamedNodeMap setNamedItemNS" .
7285+ <a for=NamedNodeMap>element</a> .
72767286
72777287<p> The <dfn method for=NamedNodeMap><code>removeNamedItem(<var>qualifiedName</var>)</code></dfn>
72787288method steps are:
@@ -7377,14 +7387,13 @@ null.
73777387<a for=Attr>value</a> .
73787388
73797389<p> To <dfn>set an existing attribute value</dfn> , given an <a>attribute</a> <var> attribute</var> ,
7380- string <var> value</var> , and string <var> sink </var> , run these steps:
7390+ string <var> value</var> , run these steps:
73817391
73827392<ol>
73837393 <li><p> If <var> attribute</var> 's <a for=Attr>element</a> is null, then set <var>attribute</var>' s
73847394 <a for=Attr>value</a> to <var> value</var> .
73857395
7386- <li><p> Otherwise, <a lt="change an attribute">change</a> <var> attribute</var> to <var> value</var> ,
7387- with <var> sink</var> .
7396+ <li><p> Otherwise, <a lt="change an attribute">change</a> <var> attribute</var> to <var> value</var> .
73887397</ol>
73897398
73907399<p> The {{Attr/value}} setter steps are to <a>set an existing attribute value</a> with <a>this</a> ,
0 commit comments