mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:28:11 +00:00
LibWeb: Allow building partial layout trees
We can now build partial layout trees (this happens for example when an element's "display" property is programmatically toggled from "none" to something else.)
This commit is contained in:
parent
127274fd42
commit
4ebb57298b
1 changed files with 4 additions and 3 deletions
|
@ -140,9 +140,10 @@ void TreeBuilder::create_layout_tree(DOM::Node& dom_node)
|
|||
|
||||
RefPtr<Node> TreeBuilder::build(DOM::Node& dom_node)
|
||||
{
|
||||
if (!is<DOM::Document>(dom_node) && dom_node.has_children()) {
|
||||
dbg() << "FIXME: Support building partial layout trees.";
|
||||
return nullptr;
|
||||
if (dom_node.parent()) {
|
||||
// We're building a partial layout tree, so start by building up the stack of parent layout nodes.
|
||||
for (auto* ancestor = dom_node.parent()->layout_node(); ancestor; ancestor = ancestor->parent())
|
||||
m_parent_stack.prepend(ancestor);
|
||||
}
|
||||
|
||||
create_layout_tree(dom_node);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue