mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +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
Notes:
sideshowbarker
2024-07-19 01:11:56 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/4ebb57298b7
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…
Reference in a new issue