Re: [whatwg/dom] Proposal: New method to reorder child nodes (#891)

Thanks @wlib, @bathos for highlighting this slot assignment behaviour. This interests me in the context of a few attempts I've made in the past to get predictable behaviour when moving chunks of DOM diagonally (ie from one parent node to another) in the least destructive way possible. I tried playing with this API to see if it could be used as a generic solution for re-ordering.

CSS positional selectors stick to DOM ordering and don't reflect assignment order, which is fair enough. More interesting was that CSS list markers and counter increments seemed to respect assignment order in Firefox, while in Chrome they first fell out of sync, and in subsequent reorderings stuck to their last update. 

[Here's a sandbox demonstrating the inconsistent behaviour](https://flems.io/#0=N4IgzgpgNhDGAuEAmIBcIB0sxhAGhADMBLGXVAbVADsBDAWwjUwAt56p8RYB7axfswA8LAIwA+AMJ8B8AAQAnCAFoeCpBAXFqAczkBXMNr18oATzlDeG8QAkAKgFkAMgGUoPeAFEYjfqlRaHGIdaiEAemsIcQBCCLFxAB0wgAck6jk5AEk5AHcguUgkfVhkOQAjC3gWCDlGWBZaamIwejA5FM8IfmJaKDk+S1o5eFoFHQh4AF4AfXKoJoBrORYlQim2eBSwVHDwnWJq-XKsHnpw3Mb4XJ1wpDPwlrB9CDBwgA4ATlEAYieX3j0PzwZSiABMAFYAOyQgAsUK+4mqLTkAHVbABBeyogDickIEFo8H0SjkSGIsEMRkG1SUtCQEVo4gwyQiaVZ5IAbulMkJ2RlMpYIPRxPYWC0IsLxHJoMLuvJePxaNp2k05MRCAoGLVLjxIHJFbJ2rlSP0UpojGB5JAGGQwOY8IVtKU5NQeB09YdiHw+nUeJy5fw5AAKclgRXUODwR1KCNRgCU6vao0Wxg6C1KMWSvPC-N5Gq1jEKClgU0SIE2212F1yuQwEAAHgwUjBTvRy+IIgXtekIlze2kxbVJK5XHUxosLXlTePtKNtDKG+aEGVIABHF7UF3KdX8TSveDGGKWK0KPg6cQAIX08Aip-P0s6RkPPv6I7HwasPBsqBICitygNKQDKRN+0RyDuBS0CkLbEGU8DutUtRfjYYgRFE0oLsi7SNs2MCOpMsCJrkfAAOTyGsMAIHIpH0P6gbwKREEVHAtCGLUKRnuaCjmIU5q0KmuiOkhijQESxABh6z7ehkPCECMNQyr48rtI0YDUORBqNLoyDHq4JLQBYYBnLUhpauSCAySx1wQN0CmvLUYKFKMiDAmAAD8bK9oQaj0OqSBTD5CgitmljlDeCHUDygoAEoQAG-61GoGgKFmAoROF8CRb24RBSKXCQFRL7UOQIBQqgABsIAAL54DQ2rMBgABWuAEIa8rMPclLAhg5TfmYGBEqMDSuI09y5MGwB0RoqA0Tw5oaY69qeBiwShMCs20U0+h9KR1XxskySKlahQePIUxkjw3XylgdKID4DHBqRy2MQd1DJF1+g9X1SADWAY08LkMU8J4g0wd0SDBi9b3JC9g1rdQwYYMjn3ff1WDilASBKNQMPUDA8gIToOgwHIF2EH0kCHdQeUYHwzzlPQhxkyGiZTNKwChXDQRGKEYMtmYUNnY6oWZBiChagNmpnKGV1fTdP0DUBWM4-GFAjDwxOk+5NGKrARJMZtSgJZATEALrBm9mRW3IoVEyTtQXTE9swKFoVKMSCgZBTUBU9Q1UFbKln08wojvKgog1XVIB0IwjXYK13AyB16AAFRyJzArwFqJVenws3lLQsCLDoZ76NQSByKIOFBCo2iqDeADcyTVdTityNKqBuvAwaoAsAHK0giaZ5kYYtrQZizVALQgocwrNwK08AVaZgwLNGiwMQ9C+iqxAaAvmS8OXiAKMozpKBtu4aA2C+t+91Dt533e9-3IKD-GqDlBAQW1CPBrJ-4f+x9NDBm0NfRMNEMCZFIrfNu-VfzEH-G-TGlc-6F2LqXHg5ckCzVLrZagsD75iAQUgwCKCM6hXQSXMuFdZpmGgB4XIhDkjaBSDeVA2hOR9D3hQgUVDMHYNmikbQixb6ByKjJUqEJUBgkjtVM2BBY5MHQI4bavoXpyB5iEagwJ8RqDkAAEQAPKOFEqodQmhjA1SAA).

This indicates some ambiguity in the 'moving without moving' behaviour – perhaps useful in future API considerations.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/891#issuecomment-1292208616

You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/dom/issues/891/1292208616@github.com>

Received on Wednesday, 26 October 2022 15:17:49 UTC