1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-21 19:55:07 +00:00
serenity/Userland/Libraries/LibWeb/SVG/SVGGElement.cpp
Andreas Kling 7e1bf4d300 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.
2022-02-05 22:50:39 +01:00

24 lines
604 B
C++

/*
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/StringBuilder.h>
#include <LibWeb/DOM/Document.h>
#include <LibWeb/Layout/SVGGraphicsBox.h>
#include <LibWeb/SVG/SVGGElement.h>
namespace Web::SVG {
SVGGElement::SVGGElement(DOM::Document& document, QualifiedName qualified_name)
: SVGGraphicsElement(document, move(qualified_name))
{
}
RefPtr<Layout::Node> SVGGElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
{
return adopt_ref(*new Layout::SVGGraphicsBox(document(), *this, move(style)));
}
}