1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-16 10:57:35 +00:00
serenity/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp
Brian Gianforcaro 1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00

41 lines
1 KiB
C++

/*
* Copyright (c) 2020, Matthew Olsson <matthewcolsson@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibGfx/Painter.h>
#include <LibWeb/CSS/StyleResolver.h>
#include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/Event.h>
#include <LibWeb/Layout/SVGSVGBox.h>
#include <LibWeb/SVG/SVGPathElement.h>
#include <LibWeb/SVG/SVGSVGElement.h>
#include <ctype.h>
namespace Web::SVG {
SVGSVGElement::SVGSVGElement(DOM::Document& document, QualifiedName qualified_name)
: SVGGraphicsElement(document, qualified_name)
{
}
RefPtr<Layout::Node> SVGSVGElement::create_layout_node()
{
auto style = document().style_resolver().resolve_style(*this);
if (style->display() == CSS::Display::None)
return nullptr;
return adopt(*new Layout::SVGSVGBox(document(), *this, move(style)));
}
unsigned SVGSVGElement::width() const
{
return attribute(HTML::AttributeNames::width).to_uint().value_or(300);
}
unsigned SVGSVGElement::height() const
{
return attribute(HTML::AttributeNames::height).to_uint().value_or(150);
}
}