Thunberg087 / vue-fragment

a very candide fragment component for Vue.js
http://jsfiddle.net/cdkn5wL3/
670 stars 51 forks source link

freezing nextSibling can cause infinite loops in code that is traversing children #72

Open mdellanoce opened 1 year ago

mdellanoce commented 1 year ago

https://github.com/Thunberg087/vue-fragment/blob/master/src/index.js#L57:L63

The expectation is that nextSibling returns null when there is no next sibling. vue-fragment appears to make nextSibling return the parent's first child when there is no next sibling. This affects code that traverses children like the following in Sizzle:

https://github.com/jquery/sizzle/blob/main/src/sizzle.js#L1257

I found a StackOverflow post where someone had the same issue several years ago: https://stackoverflow.com/questions/73033979/element-nextsibling-returns-first-sibling