mirror of
https://github.com/RGBCube/serenity
synced 2025-06-29 03:42:07 +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:
parent
3451673ac8
commit
7e1bf4d300
31 changed files with 48 additions and 91 deletions
|
@ -19,12 +19,8 @@ HTMLLabelElement::~HTMLLabelElement()
|
|||
{
|
||||
}
|
||||
|
||||
RefPtr<Layout::Node> HTMLLabelElement::create_layout_node()
|
||||
RefPtr<Layout::Node> HTMLLabelElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
|
||||
{
|
||||
auto style = document().style_computer().compute_style(*this);
|
||||
if (style->display().is_none())
|
||||
return nullptr;
|
||||
|
||||
auto layout_node = adopt_ref(*new Layout::Label(document(), this, move(style)));
|
||||
layout_node->set_inline(true);
|
||||
return layout_node;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue