mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 13:35:07 +00:00

An svg layout element without a `SVGSVGElement` ancestor caused a failed assertion before, because the svg context does not exist when `paint()` is called
32 lines
712 B
C++
32 lines
712 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>
|
|
|
|
namespace Web::SVG {
|
|
|
|
class SVGSVGElement final : public SVGGraphicsElement {
|
|
public:
|
|
using WrapperType = Bindings::SVGSVGElementWrapper;
|
|
|
|
SVGSVGElement(DOM::Document&, QualifiedName);
|
|
|
|
virtual RefPtr<Layout::Node> create_layout_node() 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; }
|
|
|
|
private:
|
|
RefPtr<Gfx::Bitmap> m_bitmap;
|
|
};
|
|
|
|
}
|