summaryrefslogtreecommitdiff
path: root/LibHTML/Layout
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-06-16 11:28:47 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-06-16 12:26:24 +0200
commitfec098b5cd1182d647dd204508977c1147a86d45 (patch)
tree78e3d5a2ed0b1438648e95da759cabedc46f162c /LibHTML/Layout
parentc52d553249b6182e8eb76ccbb7bede3db4b5fa22 (diff)
downloadserenity-fec098b5cd1182d647dd204508977c1147a86d45.zip
LibHTML: Give LayoutNodes a rect.
Also improve the layout tree dump format somewhat.
Diffstat (limited to 'LibHTML/Layout')
-rw-r--r--LibHTML/Layout/LayoutNode.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/LibHTML/Layout/LayoutNode.h b/LibHTML/Layout/LayoutNode.h
index cc83db6fd9..0e47154992 100644
--- a/LibHTML/Layout/LayoutNode.h
+++ b/LibHTML/Layout/LayoutNode.h
@@ -2,6 +2,7 @@
#include <AK/Retained.h>
#include <AK/Vector.h>
+#include <SharedGraphics/Rect.h>
class Node;
@@ -13,6 +14,10 @@ public:
void release();
int retain_count() const { return m_retain_count; }
+ const Rect& rect() const { return m_rect; }
+ void set_rect(const Rect& rect) { m_rect = rect; }
+
+ bool is_anonymous() const { return !m_node; }
const Node* node() const { return m_node; }
LayoutNode* next_sibling() { return m_next_sibling; }
@@ -50,5 +55,5 @@ private:
LayoutNode* m_last_child { nullptr };
LayoutNode* m_next_sibling { nullptr };
LayoutNode* m_previous_sibling { nullptr };
+ Rect m_rect;
};
-