From e107c83a57a44b4135356e813de8a98e604d924e Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Mon, 9 Jan 2023 07:25:05 +0300 Subject: [PATCH] LibWeb: Remove inheritance of `TableBox` from `BlockContainer` Fixup rule that table roots need to be wrapped in anonymous block boxes need to be implemeted instead of having `TableBox` inherited from `BlockContainer`. --- Userland/Libraries/LibWeb/Layout/TableBox.cpp | 4 ++-- Userland/Libraries/LibWeb/Layout/TableBox.h | 6 +++--- Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp | 2 +- Userland/Libraries/LibWeb/Layout/TableFormattingContext.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Userland/Libraries/LibWeb/Layout/TableBox.cpp b/Userland/Libraries/LibWeb/Layout/TableBox.cpp index a0a3652843..469d41e973 100644 --- a/Userland/Libraries/LibWeb/Layout/TableBox.cpp +++ b/Userland/Libraries/LibWeb/Layout/TableBox.cpp @@ -10,12 +10,12 @@ namespace Web::Layout { TableBox::TableBox(DOM::Document& document, DOM::Element* element, NonnullRefPtr style) - : Layout::BlockContainer(document, element, move(style)) + : Layout::Box(document, element, move(style)) { } TableBox::TableBox(DOM::Document& document, DOM::Element* element, CSS::ComputedValues computed_values) - : Layout::BlockContainer(document, element, move(computed_values)) + : Layout::Box(document, element, move(computed_values)) { } diff --git a/Userland/Libraries/LibWeb/Layout/TableBox.h b/Userland/Libraries/LibWeb/Layout/TableBox.h index fbe3371d0c..888c1d594f 100644 --- a/Userland/Libraries/LibWeb/Layout/TableBox.h +++ b/Userland/Libraries/LibWeb/Layout/TableBox.h @@ -6,12 +6,12 @@ #pragma once -#include +#include namespace Web::Layout { -class TableBox final : public Layout::BlockContainer { - JS_CELL(TableBox, BlockContainer); +class TableBox final : public Layout::Box { + JS_CELL(TableBox, Box); public: TableBox(DOM::Document&, DOM::Element*, NonnullRefPtr); diff --git a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp index 0e394c8d02..14460e1ee4 100644 --- a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp @@ -36,7 +36,7 @@ struct Traits : public GenericTraits { namespace Web::Layout { -TableFormattingContext::TableFormattingContext(LayoutState& state, BlockContainer const& root, FormattingContext* parent) +TableFormattingContext::TableFormattingContext(LayoutState& state, TableBox const& root, FormattingContext* parent) : FormattingContext(Type::Table, state, root, parent) { } diff --git a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.h b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.h index ea7339e740..6f34519fa4 100644 --- a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.h +++ b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.h @@ -13,7 +13,7 @@ namespace Web::Layout { class TableFormattingContext final : public FormattingContext { public: - explicit TableFormattingContext(LayoutState&, BlockContainer const&, FormattingContext* parent); + explicit TableFormattingContext(LayoutState&, TableBox const&, FormattingContext* parent); ~TableFormattingContext(); virtual void run(Box const&, LayoutMode, AvailableSpace const&) override;