2020-07-19 23:01:53 -07:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2020, Matthew Olsson <matthewcolsson@gmail.com>
|
|
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-07-19 23:01:53 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <LibGfx/Bitmap.h>
|
2020-07-23 09:44:42 -07:00
|
|
|
#include <LibWeb/SVG/SVGGraphicsElement.h>
|
2021-09-15 01:12:41 +02:00
|
|
|
#include <LibWeb/SVG/ViewBox.h>
|
2020-07-19 23:01:53 -07:00
|
|
|
|
2020-07-23 09:44:42 -07:00
|
|
|
namespace Web::SVG {
|
2020-07-19 23:01:53 -07:00
|
|
|
|
2020-07-23 09:44:42 -07:00
|
|
|
class SVGSVGElement final : public SVGGraphicsElement {
|
2020-07-19 23:01:53 -07:00
|
|
|
public:
|
2020-10-02 20:57:28 +01:00
|
|
|
using WrapperType = Bindings::SVGSVGElementWrapper;
|
|
|
|
|
|
2021-02-07 11:20:15 +01:00
|
|
|
SVGSVGElement(DOM::Document&, QualifiedName);
|
2020-07-19 23:01:53 -07:00
|
|
|
|
2021-01-06 14:27:40 +01:00
|
|
|
virtual RefPtr<Layout::Node> create_layout_node() override;
|
2020-07-19 23:01:53 -07:00
|
|
|
|
|
|
|
|
unsigned width() const;
|
|
|
|
|
unsigned height() const;
|
|
|
|
|
|
2021-08-05 10:26:09 +02:00
|
|
|
virtual bool requires_svg_container() const override { return false; }
|
|
|
|
|
virtual bool is_svg_container() const override { return true; }
|
|
|
|
|
|
2021-09-15 01:12:41 +02:00
|
|
|
Optional<ViewBox> const& view_box() { return m_view_box; }
|
|
|
|
|
|
2020-07-19 23:01:53 -07:00
|
|
|
private:
|
2021-09-15 01:12:41 +02:00
|
|
|
virtual void parse_attribute(FlyString const& name, String const& value) override;
|
|
|
|
|
|
|
|
|
|
Optional<ViewBox> m_view_box;
|
2020-07-19 23:01:53 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|