News for hackers. Stuff that matters.
Re:Modernizing the DOM Tree in Microsoft Edge by c-smile on Thursday April 20, 2017 @07:10PM (#14161721)
That case is easily manageable: you cannot insert/appendNode that has non-null parent. So you need to remove that node from its former parent first.

Problem is that their solution by design contains loops.

So on each tree traversal iteration you will need to access parent:

    Node* get_next_node(Node* that) {
      that = that->next;
      return that == that->parent->first_child ? nullptr :  that;
    }

There are no comments on this comment yet.