1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:57:35 +00:00

LibWeb: Compute element style in Layout::TreeBuilder

Instead of making each Layout::Node compute style for itself, we now
compute it in TreeBuilder before even calling create_layout_node().

For non-element DOM nodes, we create the style and layout tree node
in TreeBuilder. This allows us to move create_layout_node() from
DOM::Node to DOM::Element.
This commit is contained in:
Andreas Kling 2022-02-05 13:17:01 +01:00
parent 3451673ac8
commit 7e1bf4d300
31 changed files with 48 additions and 91 deletions

View file

@ -451,11 +451,6 @@ void Document::update_style()
set_needs_layout();
}
RefPtr<Layout::Node> Document::create_layout_node()
{
return adopt_ref(*new Layout::InitialContainingBlock(*this, style_computer().create_document_style()));
}
void Document::set_link_color(Color color)
{
m_link_color = color;