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

@ -84,7 +84,7 @@ public:
RefPtr<Node> insert_before(NonnullRefPtr<Node> node, RefPtr<Node> child, bool notify = true);
void remove_all_children();
virtual RefPtr<LayoutNode> create_layout_node(const CSS::StyleProperties* parent_style);
virtual RefPtr<Layout::Node> create_layout_node(const CSS::StyleProperties* parent_style);
virtual FlyString node_name() const = 0;
@ -115,10 +115,10 @@ public:
virtual void removed_from(Node&) { }
virtual void children_changed() { }
const LayoutNode* layout_node() const { return m_layout_node; }
LayoutNode* layout_node() { return m_layout_node; }
const Layout::Node* layout_node() const { return m_layout_node; }
Layout::Node* layout_node() { return m_layout_node; }
void set_layout_node(Badge<LayoutNode>, LayoutNode*) const;
void set_layout_node(Badge<Layout::Node>, Layout::Node*) const;
virtual bool is_child_allowed(const Node&) const { return true; }
@ -138,7 +138,7 @@ protected:
Node(Document&, NodeType);
Document* m_document { nullptr };
mutable WeakPtr<LayoutNode> m_layout_node;
mutable WeakPtr<Layout::Node> m_layout_node;
NodeType m_type { NodeType::INVALID };
bool m_needs_style_update { true };
};