w3ctag / design-reviews

W3C specs and API reviews
Creative Commons Zero v1.0 Universal
332 stars 56 forks source link

DOM state-preserving move #976

Closed noamr closed 1 month ago

noamr commented 3 months ago

こんにちは TAG-さん!

I'm requesting a TAG review of DOM state-preserving move.

This is a feature that allows moving elements around the DOM without their state being reset as a result (e.g. iframes won't reload if moved in this manner)

Further details:

You should also know that... A lot of work on this was already done in the WHATWG context, however there is still time until anything is shipped. So this is a good time to also get some input from TAG! .

jyasskin commented 1 month ago

We consider it a mistake in the platform that element movement is handled by removing and then re-inserting nodes. We would prefer if this effort fixed the existing methods rather than adding new methods. Could the designers invest in some more thorough testing to see if this breaks a significant number of pages, rather than just assuming that it will? If changing all of the element-movement methods does break things, perhaps it would be compatible to change only the newer ones that are methods on ParentNode and ChildNode. In that case, we think the slight inconsistency between, e.g., append() and appendChild() is worth the more intuitive behavior on the newer method.

Thank you for bringing this to us. The WHATWG discussion seems like the right place to dig into the compatibility question, so we're happy to let them take it from here.