Re: [whatwg/dom] Processing instruction attribute names that setAttribute() accepts don't survive reparsing (Issue #1523)

foolip left a comment (whatwg/dom#1523)

Here's the argument I was tempted to make:

> There are lots of ways to use DOM APIs to produce trees that don't survive reparsing, and what we've done here is closer to the existing `element.setAttribute()`, which is nice for consistency. Those APIs are also for the XML syntax, after all.

However, that's not a solid argument. The way that PI attributes work isn't quite like anything else, so what should it be consistent with? Moreover, both `data` and the parsed attributes are always there and in sync, and you can stumble into roundtrip issues with the seemingly innocent `pi.data += ' more="attributes"'`.

So yes, I'm OK with this!

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/1523#issuecomment-6767119106
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/dom/issues/1523/6767119106@github.com>

Received on Tuesday, 10 November 2026 12:19:59 UTC