mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:57:43 +00:00
LibWeb: Add a bare-bones SVG <g> element
This commit is contained in:
parent
92c08ad4ac
commit
7ac889e533
5 changed files with 55 additions and 0 deletions
27
Userland/Libraries/LibWeb/SVG/SVGGElement.cpp
Normal file
27
Userland/Libraries/LibWeb/SVG/SVGGElement.cpp
Normal file
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* 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()
|
||||
{
|
||||
auto style = document().style_resolver().resolve_style(*this);
|
||||
if (style->display() == CSS::Display::None)
|
||||
return nullptr;
|
||||
return adopt_ref(*new Layout::SVGGraphicsBox(document(), *this, move(style)));
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue