4 ms·
What is the usecase for this?
by kburman 6y ago
What is the usecase for this?
- jimmy2020 6y agoThis is the fastest way you can traverse in DOM tree especially if you have an app that heavily depends on manipulating dom nodes. Let's say for animation, you targeted the clicked element with transition and apply internally some logic to the dom tree elements before they got effected with this transition. In this case, stored relations really shines. Think of it when the user doesn't click once or twice, but actually hundreds of times. That wouldn't be a problem if you know what DOM is look like. And that's not applied to a known app you design. This is an algorithm, that simply designed to deal with any tree even frameworks that generate DOM Asynciously From parents to children and vice-versa.