Modernizing the DOM Tree in Microsoft Edge
So new IE’s dom::node essentially looks as<p><pre><code>    struct node {
      element* parent;
      node *first_child, *next, *previous;
    }
</code></pre>
And that was also my initial implementation of it in Sciter Engine (<a href="https://sciter.com" rel="nofollow">https://sciter.com</a>) but after some testing I’ve found that these two structures work better:<p><pre><code>    struct node {
      element* parent;
      uint node_index; // its index in parent->children
    }
    struct element: node {
      vector<node*> children;
    }
</code></pre>
a) better suits DOM manipulation/traversal needs, 
b) more compact and faster, 
c) more CSS friendly (for things like :nth-child(2)),
e) yet the structure ensures that there are no loops in the tree.