1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-23 12:47:41 +00:00

LibHTML: Refactor to go from DOM -> styled tree -> layout tree.

Frame::layout() drives everything now, it takes the DOM contained in the
frame and puts it through the tree transformations.
This commit is contained in:
Andreas Kling 2019-06-29 21:42:07 +02:00
parent 6e95b11395
commit 7eef69ad4b
20 changed files with 132 additions and 131 deletions

View file

@ -12,7 +12,6 @@ enum class NodeType : unsigned {
DOCUMENT_NODE = 9,
};
class LayoutNode;
class ParentNode;
class Node : public TreeNode<Node> {
@ -25,16 +24,8 @@ public:
bool is_document() const { return type() == NodeType::DOCUMENT_NODE; }
bool is_parent_node() const { return is_element() || is_document(); }
virtual RefPtr<LayoutNode> create_layout_node();
const LayoutNode* layout_node() const { return m_layout_node; }
LayoutNode* layout_node() { return m_layout_node; }
void set_layout_node(NonnullRefPtr<LayoutNode>);
protected:
explicit Node(NodeType);
NodeType m_type { NodeType::INVALID };
RefPtr<LayoutNode> m_layout_node;
};