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
|
|
|
|
|
|
2020-12-06 19:48:02 +01:00
|
|
|
#include <AK/Types.h>
|
2020-11-22 13:38:18 +01:00
|
|
|
#include <LibWeb/Forward.h>
|
|
|
|
|
#include <LibWeb/Layout/FormattingContext.h>
|
|
|
|
|
|
|
|
|
|
namespace Web::Layout {
|
|
|
|
|
|
|
|
|
|
class InlineFormattingContext final : public FormattingContext {
|
|
|
|
|
public:
|
2020-11-25 20:08:52 +01:00
|
|
|
InlineFormattingContext(Box& containing_block, FormattingContext* parent);
|
2020-11-22 13:38:18 +01:00
|
|
|
~InlineFormattingContext();
|
|
|
|
|
|
2020-12-06 19:48:02 +01:00
|
|
|
Box& containing_block() { return context_box(); }
|
|
|
|
|
const Box& containing_block() const { return context_box(); }
|
|
|
|
|
|
|
|
|
|
virtual void run(Box&, LayoutMode) override;
|
2020-11-22 13:38:18 +01:00
|
|
|
|
2020-12-05 20:10:39 +01:00
|
|
|
float available_width_at_line(size_t line_index) const;
|
|
|
|
|
|
2020-11-22 15:53:01 +01:00
|
|
|
void dimension_box_on_line(Box&, LayoutMode);
|
2020-11-22 13:38:18 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|