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:
|
2020-11-25 20:08:52 +01:00
|
|
|
explicit TableFormattingContext(Box&, FormattingContext* parent);
|
2020-11-22 13:38:18 +01:00
|
|
|
~TableFormattingContext();
|
|
|
|
|
|
2020-12-06 19:48:02 +01:00
|
|
|
virtual void run(Box&, LayoutMode) override;
|
2020-11-22 13:38:18 +01:00
|
|
|
|
|
|
|
|
private:
|
2020-11-22 15:53:01 +01:00
|
|
|
void calculate_column_widths(Box& row, Vector<float>& column_widths);
|
|
|
|
|
void layout_row(Box& row, Vector<float>& column_widths);
|
2020-11-22 13:38:18 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|