mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:38:11 +00:00
LibHTML: Move layout tree building to Node
This also fixes another bug with inline wrappers. Namely, we should only add inline wrappers if a block node has both non-block (inline or text) and block children.
This commit is contained in:
parent
841ae44392
commit
599edba7a3
3 changed files with 70 additions and 43 deletions
|
@ -13,6 +13,9 @@ enum class NodeType : unsigned {
|
|||
};
|
||||
|
||||
class ParentNode;
|
||||
class LayoutNode;
|
||||
class StyleResolver;
|
||||
class StyleProperties;
|
||||
|
||||
class Node : public TreeNode<Node> {
|
||||
public:
|
||||
|
@ -24,6 +27,9 @@ public:
|
|||
bool is_document() const { return type() == NodeType::DOCUMENT_NODE; }
|
||||
bool is_parent_node() const { return is_element() || is_document(); }
|
||||
|
||||
RefPtr<LayoutNode> create_layout_node(const StyleResolver&, const StyleProperties* parent_properties) const;
|
||||
RefPtr<LayoutNode> create_layout_tree(const StyleResolver&, const StyleProperties* parent_properties) const;
|
||||
|
||||
protected:
|
||||
explicit Node(NodeType);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue