Re: [whatwg/dom] Request for mechanism to determine if children changed steps are called as a result of script or parser (Issue #1288)

I'll take some more time to properly read through and respond but regarding how correct the "is changed by API" bit is.

Chromium used to (and right now WebKit still does) have at least 1 situation where a parser change is marked as API and so the script is untrusted. The XML parser would append nodes as if they were an API change. This is because a legacy deprecated SVG element (tref) is built on mutation events, and so it went down the path that fired mutation events. Chromium simply removed that element and fixed the parser, WebKit is slightly more complicated because it might be used in non-web places, BUT that's looking like the end result too.

This is the only (relevant) place that's wrong from my testing but it's possible there could be other mismatches.

> I'm wondering if it sometimes covers parser-only cases that get treated as kAPI cases incorrectly.

The main thing is we need all API changes to show as such, if some parser steps pretends it's an API that's not the end of the world, especially because in it's current form it's just used during script element parse time.

> One point I am not clear on is: is it possible for a node's children to be changed during parser as a result of a non-API action? Like, can the parser itself be responsible for under any scenario?

Yes, my understanding is that the parser itself will fire children changed steps during the course of parsing.

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

Message ID: <whatwg/dom/issues/1288/2175592798@github.com>

Received on Tuesday, 18 June 2024 09:08:13 UTC