Re: [whatwg/dom] Define processing instruction attributes (PR #1454)

@annevk commented on this pull request.



> +<div algorithm>
+<p>To <dfn>update attributes from data</dfn> for a {{ProcessingInstruction}} <a for=/>node</a>
+<var>pi</var>:
+
+<ol>
+ <li><p><a for=map>Clear</a> <var>pi</var>'s <a for=ProcessingInstruction>attribute map</a>.
+
+ <li><p>Let <var>context</var> be the result of <a>creating an element</a> given
+ <var>pi</var>'s <a>node document</a>, "<code>html</code>", and the <a>HTML namespace</a>.
+
+ <li><p>Let <var>markup</var> be the concatentation of "<code>&lt;attrs </code>",
+ <var>pi</var>'s <a for=CharacterData>data</a>, and
+ "<code>&gt;&lt;/attrs&gt;</code>".
+
+ <li><p>Let <var>fragment</var> be the result of invoking the
+ <a>fragment parsing algorithm steps</a> with <var>context</var> and <var>markup</var>.

I'm not sure why we need to preserve the error conditions for the XML case.

I don't think it's acceptable that the behavior of `new ProcessingInstruction(..., ...)` ends up depending on the global in which you invoke it. That's not good design.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/pull/1454#discussion_r2910115349
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/dom/pull/1454/review/3920607054@github.com>

Received on Tuesday, 10 March 2026 08:22:48 UTC