Skip to content

Commit

Permalink
Remove sink values from spec
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewarlow committed Apr 15, 2024
1 parent edbc74b commit ee9915e
Showing 1 changed file with 49 additions and 40 deletions.
89 changes: 49 additions & 40 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -4278,7 +4278,7 @@ empty string instead, and then do as described below, switching on the interface

<dl class=switch>
<dt>{{Attr}}
<dd><p><a>Set an existing attribute value</a> with <a>this</a>, the given value, and "Node nodeValue".
<dd><p><a>Set an existing attribute value</a> with <a>this</a>, the given value.

<dt>{{CharacterData}}
<dd><p><a>Replace data</a> with node <a>this</a>, offset 0, count <a>this</a>'s
Expand Down Expand Up @@ -4331,8 +4331,7 @@ do as defined below, switching on the interface <var>node</var> <a>implements</a
<dd><p><a>String replace all</a> with <var>value</var> within <var>node</var>.

<dt>{{Attr}}
<dd><p><a>Set an existing attribute value</a> with <var>node</var>, <var>value</var> and
"Node textContent".
<dd><p><a>Set an existing attribute value</a> with <var>node</var>, <var>value</var>.

<dt>{{CharacterData}}
<dd><p><a>Replace data</a> with node <var>node</var>, offset 0, count <var>node</var>'s
Expand Down Expand Up @@ -4455,7 +4454,8 @@ dom-Range-extractContents, dom-Range-cloneContents -->
<ol>
<li><p>Let <var>copyAttribute</var> be a <a>clone</a> of <var>attribute</var>.

<li><p><a lt="append an attribute">Append</a> <var>copyAttribute</var> to <var>copy</var>.
<li><p><a lt="append an attribute">Append</a> <var>copyAttribute</var> to <var>copy</var>,
with false.
</ol>
</li>
</ol>
Expand Down Expand Up @@ -6368,26 +6368,36 @@ given a <var>document</var>, <var>localName</var>, <var>namespace</var>, and opt
</ol>

<p>To <dfn export id=concept-element-attributes-change lt="change an attribute">change</dfn> an
<a>attribute</a> <var>attribute</var> to <var>value</var>, with string <var>sink</var>, run these steps:
<a>attribute</a> <var>attribute</var> to <var>value</var>, run these steps:

<ol>
<li><p>Let <var>oldValue</var> be <var>attribute</var>'s <a for=Attr>value</a>.</p></li>

<li><p><a>Validate and set attribute value</a> <var>value</var> for <var>attribute</var>, with
<var>attribute</var>'s <a for=Attr>element</a>, and <var>sink</var>.
<var>attribute</var>'s <a for=Attr>element</a>.

<li><p><a>Handle attribute changes</a> for <var>attribute</var> with <var>attribute</var>'s
<a for=Attr>element</a>, <var>oldValue</var>, and <var>value</var>.
<li><p>If <var>attribute</var>'s <a for=Attr>element</a> <a lt="has an attribute">has</a>
an <a>attribute</a> <var>attribute</var>, then <a>handle attribute changes</a> for
<var>attribute</var> with <var>attribute</var>'s <a for=Attr>element</a>, <var>oldValue</var>, and
<var>value</var>.

<li><p>Otherwise, throw an "{{InvalidStateError!!exception}}" {{DOMException}}.
</ol>

<p>To <dfn export id=concept-element-attributes-append lt="append an attribute">append</dfn> an
<a>attribute</a> <var>attribute</var> to an <a for=/>element</a> <var>element</var>, with optional
string <var>sink</var> (default ""), run these steps:
boolean <var>validate</var> (default true), run these steps:

<ol>
<li><p>If <var>sink</var> is not an empty string <a>Validate and set attribute value</a>
<var>attribute</var>'s <a for="Attr">value</a> for <var>attribute</var> with <var>element</var>,
and <var>sink</var>.
<li>
<p>If <var>validate</var>, then:
<ol>
<li><p><a>Validate and set attribute value</a>
<var>attribute</var>'s <a for="Attr">value</a> for <var>attribute</var> with <var>element</var>.

<li><p>If <var>element</var> <a lt="has an attribute">has</a> an <a>attribute</a>
<var>attribute</var>, then throw an "{{InvalidStateError!!exception}}" {{DOMException}}.
</ol>

<li><p><a for=list>Append</a> <var>attribute</var> to <var>element</var>'s
<a for=Element>attribute list</a>.
Expand Down Expand Up @@ -6432,12 +6442,12 @@ string <var>sink</var> (default ""), run these steps:

<p>To <dfn id=concept-element-attributes-validate-and-set-value>validate and set attribute value</dfn>
{{TrustedType}} or a string <var>value</var> for an <a>attribute</a> <var>attribute</var>, with
<a for=/>element</a> <var>element</var>, and string <var>sink</var>:
<a for=/>element</a> <var>element</var>:

<ol>
<li><p>Let <var>validValue</var> be the result of calling
<a abstract-op>get Trusted Types-compliant attribute value</a> for <var>attribute</var>, with
<var>element</var>, <var>value</var>, and <var>sink</var>. [[!TRUSTED-TYPES]]
<var>element</var>, <var>value</var>. [[!TRUSTED-TYPES]]

<li><p>Set <var>attribute</var>'s <a for=Attr>value</a> to <var>validValue</var>.
</ol>
Expand Down Expand Up @@ -6491,8 +6501,7 @@ string <var>namespace</var> (default null):</p>

<div algorithm>
<p>To <dfn export id=concept-element-attributes-set>set an attribute</dfn> given an
<a for=/>attribute</a> <var>attr</var>, an <a for=/>element</a> <var>element</var>,
and a string <var>sink</var>:
<a for=/>attribute</a> <var>attr</var>, an <a for=/>element</a> <var>element</var>.

<ol>
<li><p>If <var>attr</var>'s <a for=Attr>element</a> is neither null nor <var>element</var>,
Expand All @@ -6510,13 +6519,16 @@ and a string <var>sink</var>:

<ul>
<li><p><a>Validate and set attribute value</a> <var>attr</var>'s <a for="Attr">value</a> for
<var>attr</var> with <var>element</var>, and <var>sink</var>.
<var>attr</var> with <var>element</var>.

<li><p>If <var>element</var> <a lt="has an attribute">has</a> an <a>attribute</a>
<var>attr</var>, then <a lt="replace an attribute">replace</a> <var>oldAttr</var> with
<var>attr</var>.

<li><p><a lt="replace an attribute">Replace</a> <var>oldAttr</var> with <var>attr</var>.
<li><p>Otherwise, throw an "{{InvalidStateError!!exception}}" {{DOMException}}.
</ul>

<li><p>Otherwise, <a lt="append an attribute">append</a> <var>attr</var> to <var>element</var>
with <var>sink</var>.
<li><p>Otherwise, <a lt="append an attribute">append</a> <var>attr</var> to <var>element</var>.

<li><p>Return <var>oldAttr</var>.
</ol>
Expand All @@ -6526,7 +6538,7 @@ and a string <var>sink</var>:
<p>To <dfn export id=concept-element-attributes-set-value>set an attribute value</dfn> given an
<a for=/>element</a> <var>element</var>, a string <var>localName</var>, a string or {{TrustedType}}
<var>value</var>, an optional null or string <var>prefix</var> (default null), an optional null
or string <var>namespace</var> (default null), and an optional string <var>sink</var> (default ""):
or string <var>namespace</var> (default null):

<ol>
<li>Let <var>attribute</var> be the result of
Expand All @@ -6537,10 +6549,9 @@ or string <var>namespace</var> (default null), and an optional string <var>sink<
<var>namespace</var>, <a for=Attr>namespace prefix</a> is <var>prefix</var>,
<a for=Attr>local name</a> is <var>localName</var>, <a for=Attr>value</a> is <var>value</var>, and
<a for=Node>node document</a> is <var>element</var>'s <a for=Node>node document</a>, then
<a lt="append an attribute">append</a> this <a>attribute</a> to <var>element</var> with
<var>sink</var>, and then return.
<a lt="append an attribute">append</a> this <a>attribute</a> to <var>element</var>, and then return.

<li><p><a lt="change an attribute">Change</a> <var>attribute</var> to <var>value</var>, with <var>sink</var>.
<li><p><a lt="change an attribute">Change</a> <var>attribute</var> to <var>value</var>.
</ol>
</div>

Expand Down Expand Up @@ -6801,13 +6812,12 @@ method steps are:
and null otherwise.
<!-- This is step 2 of "get an attribute by name", modified as appropriate -->

<li><p>If <var>attribute</var> is null, create an <a>attribute</a> whose
<a for=Attr>local name</a> is <var>qualifiedName</var>, <a for=Attr>value</a> is
<var>value</var>, and <a for=Node>node document</a> is <a>this</a>'s <a for=Node>node document</a>,
then <a lt="append an attribute">append</a> this <a>attribute</a> to <a>this</a> with
"Element setAttribute", and then return.
<li><p>If <var>attribute</var> is null, create an <a>attribute</a> whose
<a for=Attr>local name</a> is <var>qualifiedName</var>, <a for=Attr>value</a> is
<var>value</var>, and <a for=Node>node document</a> is <a>this</a>'s <a for=Node>node document</a>,
then <a lt="append an attribute">append</a> this <a>attribute</a> to <a>this</a>, and then return.

<li><p><a lt="change an attribute">Change</a> <var>attribute</var> to <var>value</var>, with "Element setAttribute".
<li><p><a lt="change an attribute">Change</a> <var>attribute</var> to <var>value</var>.
</ol>

<p>The
Expand All @@ -6819,7 +6829,7 @@ method steps are:
passing <var>namespace</var> and <var>qualifiedName</var> to <a>validate and extract</a>.

<li><p><a>Set an attribute value</a> for <a>this</a> using <var>localName</var>, <var>value</var>,
and also <var>prefix</var> and <var>namespace</var>, and "Element setAttributeNS".
and also <var>prefix</var> and <var>namespace</var>.
</ol>

<p>The
Expand Down Expand Up @@ -6868,8 +6878,8 @@ method steps are:
<li><p>If <var>force</var> is not given or is true, create an <a>attribute</a> whose
<a for=Attr>local name</a> is <var>qualifiedName</var>, <a for=Attr>value</a> is the empty
string, and <a for=Node>node document</a> is <a>this</a>'s <a for=Node>node document</a>, then
<a lt="append an attribute">append</a> this <a>attribute</a> to <a>this</a> with
"Element toggleAttribute", and then return true.
<a lt="append an attribute">append</a> this <a>attribute</a> to <a>this</a>,
and then return true.

<li><p>Return false.
</ol>
Expand Down Expand Up @@ -6907,11 +6917,11 @@ method steps are to return the result of

<p>The <dfn method for=Element><code>setAttributeNode(<var>attr</var>)</code></dfn> methods steps are to
return the result of <a lt="set an attribute">setting an attribute</a> given <var>attr</var> and
<a>this</a>, and "Element setAttributeNode".
<a>this</a>.

<p>The <dfn method for=Element><code>setAttributeNodeNS(<var>attr</var>)</code></dfn> methods steps are to
return the result of <a lt="set an attribute">setting an attribute</a> given <var>attr</var>,
<a>this</a>, and "Element setAttributeNodeNS".
<a>this</a>.

<p>The <dfn method for=Element><code>removeAttributeNode(<var>attr</var>)</code></dfn> method steps
are:
Expand Down Expand Up @@ -7268,11 +7278,11 @@ method steps are to return the result of

<p>The <dfn method for=NamedNodeMap><code>setNamedItem(<var>attr</var>)</code></dfn> method steps are
to return the result of <a lt="set an attribute">setting an attribute</a> given <var>attr</var>,
<a for=NamedNodeMap>element</a>, and "NamedNodeMap setNamedItem".
<a for=NamedNodeMap>element</a>.

<p>The <dfn method for=NamedNodeMap><code>setNamedItemNS(<var>attr</var>)</code></dfn> method steps are
to return the result of <a lt="set an attribute">setting an attribute</a> given <var>attr</var>,
<a for=NamedNodeMap>element</a>, and "NamedNodeMap setNamedItemNS".
<a for=NamedNodeMap>element</a>.

<p>The <dfn method for=NamedNodeMap><code>removeNamedItem(<var>qualifiedName</var>)</code></dfn>
method steps are:
Expand Down Expand Up @@ -7377,14 +7387,13 @@ null.
<a for=Attr>value</a>.

<p>To <dfn>set an existing attribute value</dfn>, given an <a>attribute</a> <var>attribute</var>,
string <var>value</var>, and string <var>sink</var>, run these steps:
string <var>value</var>, run these steps:

<ol>
<li><p>If <var>attribute</var>'s <a for=Attr>element</a> is null, then set <var>attribute</var>'s
<a for=Attr>value</a> to <var>value</var>.

<li><p>Otherwise, <a lt="change an attribute">change</a> <var>attribute</var> to <var>value</var>,
with <var>sink</var>.
<li><p>Otherwise, <a lt="change an attribute">change</a> <var>attribute</var> to <var>value</var>.
</ol>

<p>The {{Attr/value}} setter steps are to <a>set an existing attribute value</a> with <a>this</a>,
Expand Down

0 comments on commit ee9915e

Please sign in to comment.