srctree

Robin Linden parent 23d5eebc 4908725b
style: Make sure selector-matching can access the parent node

This is needed for e.g. the descendant and child combinators.

inlinesplit
style/style.cpp added: 2, removed: 2, total 0
@@ -106,8 +106,8 @@ void style_tree_impl(StyledNode &current,
// TODO(robinlinden): emplace_back once Clang supports it (C++20/p0960). Not supported as of Clang 14.
current.children.push_back({child});
auto &child_node = current.children.back();
style_tree_impl(child_node, child, stylesheet, ctx);
child_node.parent = &current;
style_tree_impl(child_node, child, stylesheet, ctx);
}
 
current.properties = matching_rules(current, stylesheet, ctx);