LibHTML: Oops, fix build.

It's another "hacking on the train and forgetting to try a full build"
episode, this time starring LibHTML.
This commit is contained in:
Andreas Kling 2019-07-08 08:09:21 +02:00
parent ab90d2e251
commit 3c71dc4320

View file

@ -69,14 +69,14 @@ RefPtr<LayoutNode> Frame::generate_layout_tree(const StyledNode& styled_root)
}
};
Function<RefPtr<LayoutNode>(const StyledNode&, LayoutNode*)> build_layout_tree;
build_layout_tree = [&](const StyledNode& styled_node, LayoutNode* parent_layout_node) -> RefPtr<LayoutNode> {
Function<RefPtr<LayoutNode>(const StyledNode&)> build_layout_tree;
build_layout_tree = [&](const StyledNode& styled_node) -> RefPtr<LayoutNode> {
auto layout_node = create_layout_node(styled_node);
if (!layout_node)
return nullptr;
if (styled_node.has_children()) {
for (auto* styled_child = styled_node.first_child(); styled_child; styled_child = styled_child->next_sibling()) {
auto layout_child = build_layout_tree(*styled_child, layout_node.ptr());
auto layout_child = build_layout_tree(*styled_child);
if (!layout_child)
continue;
layout_node->append_child(*layout_child);
@ -85,7 +85,7 @@ RefPtr<LayoutNode> Frame::generate_layout_tree(const StyledNode& styled_root)
return layout_node;
};
return build_layout_tree(styled_root, nullptr);
return build_layout_tree(styled_root);
}
void Frame::layout()