1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01: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

@ -30,7 +30,7 @@
#include <AK/Vector.h>
#include <LibWeb/Layout/LineBoxFragment.h>
namespace Web {
namespace Web::Layout {
class LineBox {
public:
@ -38,7 +38,7 @@ public:
float width() const { return m_width; }
void add_fragment(const LayoutNode& layout_node, int start, int length, int width, int height);
void add_fragment(const Node& layout_node, int start, int length, int width, int height);
const NonnullOwnPtrVector<LineBoxFragment>& fragments() const { return m_fragments; }
NonnullOwnPtrVector<LineBoxFragment>& fragments() { return m_fragments; }
@ -48,8 +48,8 @@ public:
bool ends_in_whitespace() const;
private:
friend class LayoutBlock;
friend class Layout::InlineFormattingContext;
friend class BlockBox;
friend class InlineFormattingContext;
NonnullOwnPtrVector<LineBoxFragment> m_fragments;
float m_width { 0 };
};