2020-11-22 13:38:18 +01:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-11-22 13:38:18 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <AK/Forward.h>
|
|
|
|
|
#include <LibWeb/Layout/BlockFormattingContext.h>
|
|
|
|
|
|
|
|
|
|
namespace Web::Layout {
|
|
|
|
|
|
|
|
|
|
class TableFormattingContext final : public BlockFormattingContext {
|
|
|
|
|
public:
|
2022-02-20 15:51:24 +01:00
|
|
|
explicit TableFormattingContext(FormattingState&, BlockContainer const&, FormattingContext* parent);
|
2020-11-22 13:38:18 +01:00
|
|
|
~TableFormattingContext();
|
|
|
|
|
|
2022-02-20 15:51:24 +01:00
|
|
|
virtual void run(Box const&, LayoutMode) override;
|
2020-11-22 13:38:18 +01:00
|
|
|
|
|
|
|
|
private:
|
2022-03-28 18:42:49 +02:00
|
|
|
void calculate_column_widths(Box const& row, CSS::Length const& table_width, Vector<float>& column_widths);
|
2022-02-20 15:51:24 +01:00
|
|
|
void layout_row(Box const& row, Vector<float>& column_widths);
|
2020-11-22 13:38:18 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|