/* * 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); } void SVGSVGBox::prepare_for_replaced_layout() { auto natural_metrics = SVG::SVGSVGElement::negotiate_natural_metrics(dom_node()); set_natural_width(natural_metrics.width); set_natural_height(natural_metrics.height); set_natural_aspect_ratio(natural_metrics.aspect_ratio); } }