@@ -6406,33 +6406,17 @@ given a <var>document</var>, <var>localName</var>, <var>namespace</var>, and opt
64066406<ol>
64076407 <li><p> Let <var> oldValue</var> be <var> attribute</var> 's <a for=Attr>value</a> .</p></li>
64086408
6409- <li><p> <a>Verify and set attribute value</a> <var> value</var> for <var> attribute</var> , with
6410- <var> attribute</var> 's <a for=Attr>element</a> .
6409+ <li><p> Set <var> attribute</var> 's <a for=Attr>value</a> to <var> value</var> .
64116410
6412- <li><p> If <var> attribute</var> 's <a for=Attr>element</a>
6413- <a lt="has an attribute">has an attribute</a> , then <a>handle attribute changes</a> for
6414- <var> attribute</var> with <var> attribute</var> 's <a for=Attr>element</a> , <var> oldValue</var> , and
6415- <var> value</var> .
6416-
6417- <li><p> Otherwise, throw an "{{InvalidStateError!!exception}} " {{DOMException}} .
6411+ <li><p> <a>Handle attribute changes</a> for <var> attribute</var> with <var> attribute</var> 's
6412+ <a for=Attr>element</a> , <var> oldValue</var> , and <var> value</var> .
64186413</ol>
64196414
64206415<p> To <dfn export id=concept-element-attributes-append lt="append an attribute">append</dfn> an
6421- <a>attribute</a> <var> attribute</var> to an <a for=/>element</a> <var> element</var> , with an
6422- optional boolean <var> validate </var> (default true) :
6416+ <a>attribute</a> <var> attribute</var> to an <a for=/>element</a> <var> element</var> , run these
6417+ steps :
64236418
64246419<ol>
6425- <li>
6426- <p> If <var> validate</var> is true:
6427-
6428- <ol>
6429- <li><p> <a>Verify and set attribute value</a>
6430- <var> attribute</var> 's <a for="Attr">value</a> for <var> attribute</var> , with <var> element</var> .
6431-
6432- <li><p> If <var> element</var> <a lt="has an attribute">has</a> an <a>attribute</a>
6433- <var> attribute</var> , then throw an "{{InvalidStateError!!exception}} " {{DOMException}} .
6434- </ol>
6435-
64366420 <li><p> <a for=list>Append</a> <var> attribute</var> to <var> element</var> 's
64376421 <a for=Element>attribute list</a> .
64386422
@@ -6461,9 +6445,6 @@ optional boolean <var>validate</var> (default true):
64616445<a>attribute</a> <var> oldAttr</var> with an <a>attribute</a> <var> newAttr</var> , run these steps:
64626446
64636447<ol>
6464- <li><p> <a>Verify and set attribute value</a> <var> newAttr</var> 's <a for="Attr">value</a> for
6465- <var> newAttr</var> , with <var> oldAttr</var> 's <a for=Attr>element</a> .
6466-
64676448 <li><p> <a for=list>Replace</a> <var> oldAttr</var> by <var> newAttr</var> in <var> oldAttr</var> 's
64686449 <a for=Attr>element</a> 's <a for=Element>attribute list</a> .
64696450
@@ -6477,16 +6458,14 @@ optional boolean <var>validate</var> (default true):
64776458 <a for=Attr>value</a> .
64786459</ol>
64796460
6480- <p> To <dfn>verify and set attribute value</dfn>
6461+ <p> To <dfn>verify attribute value</dfn>
64816462{{TrustedType}} or string <var> value</var> for an <a>attribute</a> <var> attribute</var> , given an
64826463<a for=/>Element</a> <var> element</var> :
64836464
64846465<ol>
6485- <li><p> Let <var> verifiedValue </var> be the result of calling
6466+ <li><p> Return the result of calling
64866467 <a abstract-op>get Trusted Types-compliant attribute value</a> for <var> attribute</var> , with
64876468 <var> element</var> , <var> value</var> . [[!TRUSTED-TYPES]]
6488-
6489- <li><p> Set <var> attribute</var> 's <a for=Attr>value</a> to <var> verifiedValue</var> .
64906469</ol>
64916470
64926471<hr>
@@ -6551,6 +6530,11 @@ string <var>namespace</var> (default null):</p>
65516530
65526531 <li><p> If <var> oldAttr</var> is <var> attr</var> , return <var> attr</var> .
65536532
6533+ <li><p> Let <var> verifiedValue</var> be the result of calling <a>verify attribute value</a>
6534+ <var> attr</var> 's <a for=Attr>value</a> for <var> attr</var> , with <var> element</var> .
6535+
6536+ <li><p> Set <var> attr</var> 's <a for=Attr>value</a> to <var> verifiedValue</var> .
6537+
65546538 <li><p> If <var> oldAttr</var> is non-null, then <a lt="replace an attribute">replace</a>
65556539 <var> oldAttr</var> with <var> attr</var> .
65566540
@@ -6571,14 +6555,30 @@ or string <var>namespace</var> (default null):
65716555 <a lt="get an attribute by namespace and local name">getting an attribute</a> given
65726556 <var> namespace</var> , <var> localName</var> , and <var> element</var> .
65736557
6574- <li> If <var> attribute</var> is null, create an <a>attribute</a> whose <a for=Attr>namespace</a> is
6575- <var> namespace</var> , <a for=Attr>namespace prefix</a> is <var> prefix</var> ,
6576- <a for=Attr>local name</a> is <var> localName</var> , <a for=Attr>value</a> is <var> value</var> , and
6577- <a for=Node>node document</a> is <var> element</var> 's <a for=Node>node document</a> , then
6578- <a lt="append an attribute">append</a> this <a>attribute</a> to <var> element</var> , and then
6579- return.
6558+ <li><p> Let <var> attributeExists</var> be false if <var> attribute</var> is null, and true otherwise.
6559+
6560+ <li><p> If <var> attributeExists</var> is false, set <var> attribute</var> to an <a>attribute</a>
6561+ whose <a for=Attr>namespace</a> is <var> namespace</var> , <a for=Attr>namespace prefix</a> is
6562+ <var> prefix</var> , <a for=Attr>local name</a> is <var> localName</var> , <a for=Attr>value</a> is
6563+ <var> value</var> , and <a for=Node>node document</a> is <var> element</var> 's <a for=Node>node
6564+ document</a> .
65806565
6581- <li><p> <a lt="change an attribute">Change</a> <var> attribute</var> to <var> value</var> .
6566+ <li><p> Let <var> verifiedValue</var> be the result of calling <a>verify attribute value</a>
6567+ <var> value</var> for <var> attribute</var> , with <var> element</var> .
6568+
6569+ <li><p> Set <var> attributeExists</var> to true if <var> element</var> <a lt="has an attribute">has
6570+ an attribute</a> <var> attribute</var> ; otherwise false.
6571+
6572+ <li><p> If <var> attributeExists</var> is true, <a lt="change an attribute">change</a>
6573+ <var> attribute</var> to <var> verifiedValue</var> .
6574+
6575+ <li><p> Otherwise:
6576+ <ol>
6577+ <li><p> Set <var> attribute</var> 's <a for=Attr>value</a> to <var> verifiedValue</var> .
6578+
6579+ <li><p> <a lt="append an attribute">Append</a> this <a>attribute</a> to
6580+ <var> element</var> .
6581+ </ol>
65826582</ol>
65836583</div>
65846584
@@ -6839,12 +6839,25 @@ method steps are:
68396839 and null otherwise.
68406840 <!-- This is step 2 of "get an attribute by name", modified as appropriate -->
68416841
6842- <li><p> If <var> attribute</var> is null, create an <a>attribute</a> whose
6843- <a for=Attr>local name</a> is <var> qualifiedName</var> , <a for=Attr>value</a> is
6844- <var> value</var> , and <a for=Node>node document</a> is <a>this</a> 's <a for=Node>node document</a> ,
6845- then <a lt="append an attribute">append</a> this <a>attribute</a> to <a>this</a> , and then return.
6842+ <li><p> Let <var> attributeExists</var> be false if <var> attribute</var> is null, and true otherwise.
6843+
6844+ <li><p> If <var> attributeExists</var> is false, set <var> attribute</var> to an <a>attribute</a>
6845+ whose <a for=Attr>local name</a> is <var> qualifiedName</var> , <a for=Attr>value</a> is
6846+ <var> value</var> , and <a for=Node>node document</a> is <a>this</a> 's <a for=Node>node
6847+ document</a> .
6848+
6849+ <li><p> Let <var> verifiedValue</var> be the result of calling <a>verify attribute value</a>
6850+ <var> value</var> for <var> attribute</var> , with <a>this</a> .
68466851
6847- <li><p> <a lt="change an attribute">Change</a> <var> attribute</var> to <var> value</var> .
6852+ <li><p> Set <var> attribute</var> 's <a for=Attr>value</a> to <var> verifiedValue</var> .
6853+
6854+ <li><p> Set <var> attributeExists</var> to true if <a>this</a> <a lt="has an attribute">has an
6855+ attribute</a> <var> attribute</var> ; otherwise false.
6856+
6857+ <li><p> If <var> attributeExists</var> is true, <a lt="change an attribute">change</a>
6858+ <var> attribute</var> to <var> value</var> .
6859+
6860+ <li><p> Otherwise <a lt="append an attribute">append</a> this <a>attribute</a> to <a>this</a> .
68486861</ol>
68496862
68506863<p> The
@@ -7414,7 +7427,13 @@ string <var>value</var>, run these steps:
74147427 <li><p> If <var> attribute</var> 's <a for=Attr>element</a> is null, then set <var>attribute</var>' s
74157428 <a for=Attr>value</a> to <var> value</var> .
74167429
7417- <li><p> Otherwise, <a lt="change an attribute">change</a> <var> attribute</var> to <var> value</var> .
7430+ <li><p> Otherwise:
7431+ <ol>
7432+ <li><p> Let <var> verifiedValue</var> be the result of calling <a>verify attribute value</a>
7433+ <var> value</var> for <var> attribute</var> , with <a>this</a> .
7434+
7435+ <li><p> <a lt="change an attribute">Change</a> <var> attribute</var> to <var> verifiedValue</var> .
7436+ </ol>
74187437</ol>
74197438
74207439<p> The {{Attr/value}} setter steps are to <a>set an existing attribute value</a> with <a>this</a>
0 commit comments