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

@foolip commented on this pull request.



> + <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>. If this
+ throws an exception, then return.
+
+ <li>
+  <p>If <var>fragment</var>'s <a>first child</a> is an <a for=/>element</a>:
+
+  <ol>
+   <li><p>Let <var>element</var> be the <a>first child</a> of <var>fragment</var>.
+
+   <li><p>Assert: <var>element</var> is an <a for=/>element</a> with <a for=Element>local name</a>
+   "<code>attrs</code>".
+
+   <li><p><a for=list>For each</a> <var>attribute</var> of <var>element</var>'s
+   <a for=Element>attribute list</a>, set <var>pi</var>'s
+   <a for=ProcessingInstruction>attribute map</a>[<var>attribute</var>'s <a for=Attr>local name</a>]

Ignore the "huh" about single quotes, that's valid XML syntax and I just never knew...

> But `<?xml-stylesheet x:href="" href="..."?>` "works" fine today in browsers.

Oh, I didn't realize that worked. It looks like the reason in Chromium is that this code path uses a SAX parser with a "start element" handler that just ignores namespaces. That's not possible to specify using the XML fragment parser like I attempted here.

One option is to measure how common this is and then change implementations to be stricter about this.

But this could all be moot if we don't use the XML parser at all, so let me try to summarize that discussion first.

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

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

Received on Tuesday, 10 March 2026 20:46:03 UTC