Files
ladybird/Libraries/LibWeb/Layout/SVGSVGBox.h
Shannon Booth f87041bf3a LibGC+Everywhere: Factor out a LibGC from LibJS
Resulting in a massive rename across almost everywhere! Alongside the
namespace change, we now have the following names:

 * JS::NonnullGCPtr -> GC::Ref
 * JS::GCPtr -> GC::Ptr
 * JS::HeapFunction -> GC::Function
 * JS::CellImpl -> GC::Cell
 * JS::Handle -> GC::Root
2024-11-15 14:49:20 +01:00

41 lines
1.1 KiB
C++

/*
* Copyright (c) 2020, Matthew Olsson <mattco@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/Layout/ReplacedBox.h>
#include <LibWeb/SVG/SVGSVGElement.h>
namespace Web::Layout {
class SVGSVGBox final : public ReplacedBox {
GC_CELL(SVGSVGBox, ReplacedBox);
GC_DECLARE_ALLOCATOR(SVGSVGBox);
public:
SVGSVGBox(DOM::Document&, SVG::SVGSVGElement&, CSS::StyleProperties);
virtual ~SVGSVGBox() override = default;
SVG::SVGSVGElement& dom_node() { return verify_cast<SVG::SVGSVGElement>(ReplacedBox::dom_node()); }
SVG::SVGSVGElement const& dom_node() const { return verify_cast<SVG::SVGSVGElement>(ReplacedBox::dom_node()); }
virtual bool can_have_children() const override { return true; }
virtual GC::Ptr<Painting::Paintable> create_paintable() const override;
virtual void prepare_for_replaced_layout() override;
private:
virtual bool is_svg_svg_box() const final { return true; }
[[nodiscard]] Optional<CSSPixelFraction> calculate_intrinsic_aspect_ratio() const;
};
template<>
inline bool Node::fast_is<SVGSVGBox>() const { return is_svg_svg_box(); }
}