1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:17:35 +00:00

LibWeb: Rename LayoutNode classes and move them into Layout namespace

Bring the names of various boxes closer to spec language. This should
hopefully make things easier to understand and hack on. :^)

Some notable changes:

- LayoutNode -> Layout::Node
- LayoutBox -> Layout::Box
- LayoutBlock -> Layout::BlockBox
- LayoutReplaced -> Layout::ReplacedBox
- LayoutDocument -> Layout::InitialContainingBlockBox
- LayoutText -> Layout::TextNode
- LayoutInline -> Layout::InlineNode

Note that this is not strictly a "box tree" as we also hang inline/text
nodes in the same tree, and they don't generate boxes. (Instead, they
contribute line box fragments to their containing block!)
This commit is contained in:
Andreas Kling 2020-11-22 15:53:01 +01:00
parent f358f2255f
commit 5aeab9878e
114 changed files with 863 additions and 880 deletions

View file

@ -34,23 +34,23 @@ class FormattingContext {
public:
virtual void run(LayoutMode) = 0;
LayoutBox& context_box() { return m_context_box; }
const LayoutBox& context_box() const { return m_context_box; }
Box& context_box() { return m_context_box; }
const Box& context_box() const { return m_context_box; }
protected:
FormattingContext(LayoutBox&);
FormattingContext(Box&);
virtual ~FormattingContext();
static void layout_inside(LayoutBox&, LayoutMode);
static void layout_inside(Box&, LayoutMode);
struct ShrinkToFitResult {
float preferred_width { 0 };
float preferred_minimum_width { 0 };
};
ShrinkToFitResult calculate_shrink_to_fit_widths(LayoutBox&);
ShrinkToFitResult calculate_shrink_to_fit_widths(Box&);
LayoutBox& m_context_box;
Box& m_context_box;
};
}