From 48edaa2085d06bc8c129a70bcfd69021e3adf555 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Wed, 16 Feb 2022 16:32:18 +0000 Subject: [PATCH] LibWeb: Remove content-size hack from SVGFormattingContext Everything functions fine without it. :^) --- .../Libraries/LibWeb/Layout/SVGFormattingContext.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/Userland/Libraries/LibWeb/Layout/SVGFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/SVGFormattingContext.cpp index af4fb3fe83c..8d273aa9050 100644 --- a/Userland/Libraries/LibWeb/Layout/SVGFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/SVGFormattingContext.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2021, Andreas Kling + * Copyright (c) 2022, Sam Atkins * * SPDX-License-Identifier: BSD-2-Clause */ @@ -7,7 +8,6 @@ #include #include #include -#include namespace Web::Layout { @@ -22,12 +22,6 @@ SVGFormattingContext::~SVGFormattingContext() void SVGFormattingContext::run(Box& box, LayoutMode) { - // FIXME: This formatting context is basically a total hack. - // It works by computing the united bounding box of all 's - // within an , and using that as the size of this box. - - Gfx::FloatRect total_bounding_box; - box.for_each_in_subtree_of_type([&](auto& descendant) { if (is(descendant)) { auto& geometry_box = static_cast(descendant); @@ -40,14 +34,10 @@ void SVGFormattingContext::run(Box& box, LayoutMode) geometry_box.set_offset(bounding_box.top_left()); geometry_box.set_content_size(bounding_box.size()); - - total_bounding_box = total_bounding_box.united(path.bounding_box()); } return IterationDecision::Continue; }); - - box.set_content_size(total_bounding_box.size()); } }