1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:48:11 +00:00
serenity/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.h
Andreas Kling 674b6f5385 LibWeb: Call the FlexFormattingContext context box "flow_container"
This is what the spec calls it and makes the code much less ambiguous.
2021-10-13 23:56:26 +02:00

32 lines
794 B
C++

/*
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/Layout/FormattingContext.h>
namespace Web::Layout {
struct FlexItem;
class FlexFormattingContext final : public FormattingContext {
public:
FlexFormattingContext(Box& flex_container, FormattingContext* parent);
~FlexFormattingContext();
virtual bool inhibits_floating() const override { return true; }
virtual void run(Box&, LayoutMode) override;
private:
void generate_anonymous_flex_items(Box& flex_container, Vector<FlexItem>&);
bool is_row_layout() const { return m_flex_direction == CSS::FlexDirection::Row || m_flex_direction == CSS::FlexDirection::RowReverse; }
CSS::FlexDirection m_flex_direction {};
};
}