mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 11:55:12 +00:00

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.
37 lines
931 B
C++
37 lines
931 B
C++
/*
|
|
* Copyright (c) 2020, Matthew Olsson <matthewcolsson@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibGfx/Bitmap.h>
|
|
#include <LibWeb/SVG/SVGGraphicsElement.h>
|
|
#include <LibWeb/SVG/ViewBox.h>
|
|
|
|
namespace Web::SVG {
|
|
|
|
class SVGSVGElement final : public SVGGraphicsElement {
|
|
public:
|
|
using WrapperType = Bindings::SVGSVGElementWrapper;
|
|
|
|
SVGSVGElement(DOM::Document&, QualifiedName);
|
|
|
|
virtual RefPtr<Layout::Node> create_layout_node(NonnullRefPtr<CSS::StyleProperties>) override;
|
|
|
|
unsigned width() const;
|
|
unsigned height() const;
|
|
|
|
virtual bool requires_svg_container() const override { return false; }
|
|
virtual bool is_svg_container() const override { return true; }
|
|
|
|
Optional<ViewBox> const& view_box() { return m_view_box; }
|
|
|
|
private:
|
|
virtual void parse_attribute(FlyString const& name, String const& value) override;
|
|
|
|
Optional<ViewBox> m_view_box;
|
|
};
|
|
|
|
}
|