1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:17:45 +00:00

LibHTML: Get rid of the style tree

We now create a layout tree directly from the DOM tree.
This way we don't actually lose text nodes ^)
This commit is contained in:
Sergey Bugaev 2019-09-21 15:32:17 +03:00 committed by Andreas Kling
parent a9ebd676e5
commit fd0aa5dd43
22 changed files with 126 additions and 261 deletions

View file

@ -2,13 +2,13 @@
#include <AK/NonnullRefPtr.h>
#include <AK/Vector.h>
#include <LibDraw/Rect.h>
#include <LibHTML/CSS/StyleProperties.h>
#include <LibHTML/Layout/ComputedStyle.h>
#include <LibHTML/TreeNode.h>
#include <LibDraw/Rect.h>
class Node;
class LayoutBlock;
class StyledNode;
class LayoutNode : public TreeNode<LayoutNode> {
public:
@ -49,16 +49,15 @@ public:
virtual LayoutNode& inline_wrapper() { return *this; }
StyledNode* styled_node() { return m_styled_node; }
const StyledNode* styled_node() const { return m_styled_node; }
const StyleProperties& style_properties() const { return m_style_properties; }
protected:
explicit LayoutNode(const Node*, const StyledNode*);
explicit LayoutNode(const Node*, StyleProperties&&);
private:
const Node* m_node { nullptr };
RefPtr<StyledNode> m_styled_node;
StyleProperties m_style_properties;
ComputedStyle m_style;
Rect m_rect;
};