@@ -6678,50 +6678,37 @@ string <var>namespace</var> (default null):</p>
6678
6678
6679
6679
<div algorithm>
6680
6680
<p> To <dfn export id=concept-element-attributes-set-value>set an attribute value</dfn> given an
6681
- <a for=/>element</a> <var> element</var> , a string <var> localName</var> , a string or {{TrustedType}}
6682
- <var> value</var> , an optional null or string <var> prefix</var> (default null), an optional null or
6683
- string <var> namespace</var> (default null), and an optional boolean <var> verify</var> (default
6684
- false):
6681
+ <a for=/>element</a> <var> element</var> , a string <var> localName</var> , a string <var> value</var> ,
6682
+ an optional null or string <var> prefix</var> (default null), and an optional null or string
6683
+ <var> namespace</var> (default null):
6685
6684
6686
6685
<ol>
6687
- <li> Let <var> attribute</var> be the result of
6686
+ <li><p> Let <var> attribute</var> be the result of
6688
6687
<a lt="get an attribute by namespace and local name">getting an attribute</a> given
6689
6688
<var> namespace</var> , <var> localName</var> , and <var> element</var> .
6690
6689
6691
- <li><p> Let <var> attributeExists</var> be false if <var> attribute</var> is null; otherwise true.
6692
-
6693
- <li><p> If <var> attributeExists</var> is false, then set <var> attribute</var> to an <a>attribute</a>
6694
- whose <a for=Attr>namespace</a> is <var> namespace</var> , <a for=Attr>namespace prefix</a> is
6690
+ <li><p> If <var> attribute</var> is null, then set attribute to an <a>attribute</a> whose
6691
+ <a for=Attr>namespace</a> is <var> namespace</var> , <a for=Attr>namespace prefix</a> is
6695
6692
<var> prefix</var> , <a for=Attr>local name</a> is <var> localName</var> , <a for=Attr>value</a> is
6696
6693
<var> value</var> , and <a for=Node>node document</a> is <var> element</var> 's
6697
6694
<a for=Node>node document</a> .
6698
6695
6699
- <li><p> Let <var> verifiedValue</var> be <var> value</var> .
6700
-
6701
- <li>
6702
- <p> If <var> verify</var> is true:
6703
-
6704
- <ol>
6705
- <li><p> Set <var> verifiedValue</var> to the result of
6706
- <a lt="verify attribute value">verifying an attribute value</a> given <var> value</var> ,
6707
- <var> attribute</var> , and <var> element</var> .
6708
-
6709
- <li><p> Set <var> attributeExists</var> to true if <var> element</var>
6710
- <a lt="has an attribute">has an attribute</a> <var> attribute</var> ; otherwise false.
6711
- </ol>
6712
- </li>
6713
-
6714
- <li><p> If <var> attributeExists</var> is true, <a lt="change an attribute">change</a>
6715
- <var> attribute</var> to <var> verifiedValue</var> .
6696
+ <li><p> Let <var> verifiedValue</var> be the result of
6697
+ <a lt="verify attribute value">verifying an attribute value</a> given <var> value</var> ,
6698
+ <var> attribute</var> , and <var> element</var> .
6716
6699
6717
- <li>
6718
- <p> Otherwise:
6700
+ <li><p> Set <var> attribute</var> to the result of
6701
+ <a lt="get an attribute by namespace and local name">getting an attribute</a> given
6702
+ <var> namespace</var> , <var> localName</var> , and <var> element</var> .
6719
6703
6720
- <ol>
6721
- <li><p> Set <var> attribute</var> 's <a for=Attr>value</a> to <var> verifiedValue</var> .
6704
+ <li><p> If <var> attribute</var> is null, create an <a>attribute</a> whose <a for=Attr>namespace</a>
6705
+ is <var> namespace</var> , <a for=Attr>namespace prefix</a> is <var> prefix</var> ,
6706
+ <a for=Attr>local name</a> is <var> localName</var> , <a for=Attr>value</a> is
6707
+ <var> verifiedValue</var> , and <a for=Node>node document</a> is <var> element</var> 's
6708
+ <a for=Node>node document</a> , then <a lt="append an attribute">append</a> this <a>attribute</a> to
6709
+ <var> element</var> , and then return.
6722
6710
6723
- <li><p> <a lt="append an attribute">Append</a> this <a>attribute</a> to <var> element</var> .
6724
- </ol>
6711
+ <li><p> <a lt="change an attribute">Change</a> <var> attribute</var> to <var> verifiedValue</var> .
6725
6712
</ol>
6726
6713
</div>
6727
6714
@@ -6980,32 +6967,26 @@ method steps are:
6980
6967
<li><p> Let <var> attribute</var> be the first <a>attribute</a> in <a>this</a> 's
6981
6968
<a for=Element>attribute list</a> whose <a for=Attr>qualified name</a> is <var> qualifiedName</var> ,
6982
6969
and null otherwise.
6983
- <!-- This is step 2 of "get an attribute by name", modified as appropriate -->
6984
-
6985
- <li><p> Let <var> attributeExists</var> be false if <var> attribute</var> is null; otherwise true.
6986
6970
6987
- <li><p> If <var> attributeExists </var> is false , then set <var> attribute</var> to an <a>attribute</a>
6971
+ <li><p> If <var> attribute </var> is null , then set <var> attribute</var> to an <a>attribute</a>
6988
6972
whose <a for=Attr>local name</a> is <var> qualifiedName</var> , <a for=Attr>value</a> is
6989
6973
<var> value</var> , and <a for=Node>node document</a> is <a>this</a> 's <a for=Node>node document</a> .
6990
6974
6991
6975
<li><p> Let <var> verifiedValue</var> be the result of
6992
6976
<a lt="verify attribute value">verifying an attribute value</a> given <var> value</var> ,
6993
6977
<var> attribute</var> , and <a>this</a> .
6994
6978
6995
- <li><p> Set <var> attributeExists</var> to true if <a>this</a>
6996
- <a lt="has an attribute">has an attribute</a> <var> attribute</var> ; otherwise false.
6997
-
6998
- <li><p> If <var> attributeExists</var> is true, <a lt="change an attribute">change</a>
6999
- <var> attribute</var> to <var> verifiedValue</var> .
7000
-
7001
- <li>
7002
- <p> Otherwise:
6979
+ <li><p> Set <var> attribute</var> to the first <a>attribute</a> in <a>this</a> 's
6980
+ <a for=Element>attribute list</a> whose <a for=Attr>qualified name</a> is <var> qualifiedName</var> ,
6981
+ and null otherwise.
7003
6982
7004
- <ol>
7005
- <li><p> Set <var> attribute</var> 's <a for=Attr>value</a> to <var> verifiedValue</var> .
6983
+ <li><p> If <var> attribute</var> is null, create an <a>attribute</a> whose
6984
+ <a for=Attr>local name</a> is <var> qualifiedName</var> , <a for=Attr>value</a> is
6985
+ <var> verifiedValue</var> , and <a for=Node>node document</a> is <a>this</a> 's
6986
+ <a for=Node>node document</a> , then <a lt="append an attribute">append</a> this <a>attribute</a>
6987
+ to <a>this</a> , and then return.
7006
6988
7007
- <li><p> <a lt="append an attribute">Append</a> this <a>attribute</a> to <var> element</var> .
7008
- </ol>
6989
+ <li><p> <a lt="change an attribute">Change</a> <var> attribute</var> to <var> verifiedValue</var> .
7009
6990
</ol>
7010
6991
7011
6992
<p> The
0 commit comments