mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 16:58:11 +00:00

This is preparation for allowing blocks with their own internal BFC to flow around floating boxes in the parent BFC. Note that IFC still has the available_space_for_line() API, which returns space available within the IFC's own containing block, while the BFC available_space_for_line() returns space available within its root.
37 lines
1.1 KiB
C++
37 lines
1.1 KiB
C++
/*
|
|
* Copyright (c) 2020-2022, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Types.h>
|
|
#include <LibWeb/Forward.h>
|
|
#include <LibWeb/Layout/BlockContainer.h>
|
|
#include <LibWeb/Layout/FormattingContext.h>
|
|
|
|
namespace Web::Layout {
|
|
|
|
class InlineFormattingContext final : public FormattingContext {
|
|
public:
|
|
InlineFormattingContext(FormattingState&, BlockContainer const& containing_block, BlockFormattingContext& parent);
|
|
~InlineFormattingContext();
|
|
|
|
BlockFormattingContext& parent();
|
|
BlockFormattingContext const& parent() const;
|
|
|
|
BlockContainer const& containing_block() const { return static_cast<BlockContainer const&>(context_box()); }
|
|
|
|
virtual void run(Box const&, LayoutMode) override;
|
|
|
|
void dimension_box_on_line(Box const&, LayoutMode);
|
|
|
|
AvailableSpaceForLineInfo available_space_for_line(float y) const;
|
|
|
|
private:
|
|
void generate_line_boxes(LayoutMode);
|
|
void apply_justification_to_fragments(FormattingState::NodeState const& containing_block_state, CSS::TextJustify, LineBox&, bool is_last_line);
|
|
};
|
|
|
|
}
|