Make Node store pointers to its next sibling, and its first/last child
The Node
struct corresponds to an SVG XML element. In our quasi-DOM tree, a Node
has a Vec
of children.
However, when we convert the CSS cascading code to use the rust-selectors crate from Servo, it will be more useful to have a different kind of tree structure. Rust-selectors wants a representation where each Node
can retrieve its next sibling, and also its first and last child. This is so CSS cascading can be implemented easily.
The Kuchiki crate has an example of such an implementation, and it uses rust-selectors to style HTML.