- From: Anne van Kesteren <notifications@github.com>
- Date: Fri, 24 Apr 2026 11:13:46 -0700
- To: whatwg/dom <dom@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/dom/pull/1454/review/4172525620@github.com>
@annevk commented on this pull request.
> +<ol>
+ <li><p>Set <var>name</var> to <var>name</var> in <a>ASCII lowercase</a>.
+
+ <li><p>Return <a>this</a>'s <a for=ProcessingInstruction>attribute map</a>[<var>name</var>]
+ <a for=map>with default</a> null.
+</ol>
+</div>
+
+<div algorithm>
+<p>The
+<dfn method for=ProcessingInstruction><code>setAttribute(<var>name</var>, <var>value</var>)</code></dfn>
+method steps are:
+
+<ol>
+ <li><p>If <var>name</var> is not a <a>valid attribute local name</a>, then <a>throw</a> an
+ "{{InvalidCharacterError!!exception}}" {{DOMException}}.
I think for other maps (e.g., `DOMTokenList`) we validate this for each accessor. Should we do that here as well?
> +
+ <li><p>Set <var>name</var> to <var>name</var> in <a>ASCII lowercase</a>.
+
+ <li><p>Let <var>attributes</var> be <a>this</a>'s <a for=ProcessingInstruction>attribute map</a>.
+
+ <li>
+ <p>If <var>attributes</var>[<var>name</var>] does not <a for=set>exist</a>:
+
+ <ol>
+ <li><p>If <var>force</var> is not given or is true, set <var>attributes</var>[<var>name</var>]
+ to the empty string, <a>update data from attributes</a> for <a>this</a>, and then return true.
+
+ <li><p>Return false.
+ </ol>
+
+ <li><p>Otherwise, if <var>force</var> is not given or is false, <a for=map>remove</a>
No need for Otherwise as we use early returns.
> + <li><p>Set <var>name</var> to <var>name</var> in <a>ASCII lowercase</a>.
+
+ <li><p>Return true if <a>this</a>'s <a for=ProcessingInstruction>attribute map</a>[<var>name</var>]
+ <a for=set>exists</a>; otherwise false.
+</ol>
+</div>
+
+<div algorithm>
+<p>To <dfn export for=ProcessingInstruction id=concept-pi-initialize>initialize</dfn> a
+{{ProcessingInstruction}} <a for=/>node</a> <var>pi</var> with <var>target</var> and
+<var>data</var>:
+
+<ol>
+ <li><p>If <var>target</var> does not match the <code>[=XML/Name=]</code> production, then
+ <a>throw</a> an "{{InvalidCharacterError!!exception}}" {{DOMException}}.
+ <!-- DOM3 does not check for "xml" -->
I think at this point we can remove the DOM3 comment.
> + <a for=set>exists</a>; otherwise false.
+</ol>
+</div>
+
+<div algorithm>
+<p>To <dfn export for=ProcessingInstruction id=concept-pi-initialize>initialize</dfn> a
+{{ProcessingInstruction}} <a for=/>node</a> <var>pi</var> with <var>target</var> and
+<var>data</var>:
+
+<ol>
+ <li><p>If <var>target</var> does not match the <code>[=XML/Name=]</code> production, then
+ <a>throw</a> an "{{InvalidCharacterError!!exception}}" {{DOMException}}.
+ <!-- DOM3 does not check for "xml" -->
+
+ <li><p>If <var>data</var> contains the string "<code>?></code>", then <a>throw</a> an
+ "{{InvalidCharacterError!!exception}}" {{DOMException}}. <!-- Gecko does this. -->
We can also drop the Gecko comment.
--
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/pull/1454#pullrequestreview-4172525620
You are receiving this because you are subscribed to this thread.
Message ID: <whatwg/dom/pull/1454/review/4172525620@github.com>
Received on Friday, 24 April 2026 18:13:50 UTC