summaryrefslogtreecommitdiff
path: root/src/core/CSS.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/CSS.cpp')
-rw-r--r--src/core/CSS.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/core/CSS.cpp b/src/core/CSS.cpp
index 8beb075..c3900e8 100644
--- a/src/core/CSS.cpp
+++ b/src/core/CSS.cpp
@@ -116,16 +116,22 @@ std::vector<Rooted<SelectorNode>> SelectorNode::append(
if (edge->getTarget()->getEdges().size() == 0) {
// if there are no more subsequent edges this is a leafe we could
// not merge, because it is already present in the Tree.
- out.push_back(edge->getTarget());
+ out.push_back(children[0]);
} else {
// otherwise we go into recursion.
for (auto &e : edge->getTarget()->getEdges()) {
+ Rooted<SelectorEdge> e2 {e};
std::vector<Rooted<SelectorNode>> childLeafs =
- children[0]->append(e);
+ children[0]->append(e2);
out.insert(out.end(), childLeafs.begin(), childLeafs.end());
}
}
}
return out;
}
+
+std::vector<Rooted<SelectorNode>> SelectorNode::append(Rooted<SelectorNode> node){
+ const Rooted<SelectorEdge> e {new SelectorEdge{node->getManager(), node}};
+ return std::move(append(e));
+}
}