/* * Copyright (c) 2020, Matthew Olsson * Copyright (c) 2022-2024, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #include #include #include #include #include namespace Web::Layout { GC_DEFINE_ALLOCATOR(SVGSVGBox); SVGSVGBox::SVGSVGBox(DOM::Document& document, SVG::SVGSVGElement& element, GC::Ref style) : ReplacedBox(document, element, style) { } GC::Ptr SVGSVGBox::create_paintable() const { return Painting::SVGSVGPaintable::create(*this); } CSS::SizeWithAspectRatio SVGSVGBox::natural_size() const { auto metrics = SVG::SVGSVGElement::negotiate_natural_metrics(dom_node()); return { metrics.width, metrics.height, metrics.aspect_ratio }; } }