diff options
author | Andreas Kling <kling@serenityos.org> | 2022-02-05 13:17:01 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-02-05 22:50:39 +0100 |
commit | 7e1bf4d300b42ea1aa3b4439e113083116bc215b (patch) | |
tree | 7418a430e313a38972d03410c5451ee343d797c9 /Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp | |
parent | 3451673ac8fc454556a9189152a301f702e69390 (diff) | |
download | serenity-7e1bf4d300b42ea1aa3b4439e113083116bc215b.zip |
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.
Diffstat (limited to 'Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp')
-rw-r--r-- | Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp index f001ebd778..f7583076a0 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp @@ -19,11 +19,8 @@ SVGSVGElement::SVGSVGElement(DOM::Document& document, QualifiedName qualified_na { } -RefPtr<Layout::Node> SVGSVGElement::create_layout_node() +RefPtr<Layout::Node> SVGSVGElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style) { - auto style = document().style_computer().compute_style(*this); - if (style->display().is_none()) - return nullptr; return adopt_ref(*new Layout::SVGSVGBox(document(), *this, move(style))); } |