mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:58:11 +00:00
LibHTML: Add a Frame class, start fleshing out recursive layout.
Layout is initiated from Frame::layout(). It makes the document's layout node as wide as the frame, and then we'll take it from there.
This commit is contained in:
parent
f49e5c6732
commit
0db2f3cbe6
9 changed files with 91 additions and 3 deletions
|
@ -16,6 +16,7 @@ public:
|
|||
int retain_count() const { return m_retain_count; }
|
||||
|
||||
const Rect& rect() const { return m_rect; }
|
||||
Rect& rect() { return m_rect; }
|
||||
void set_rect(const Rect& rect) { m_rect = rect; }
|
||||
|
||||
LayoutStyle& style() { return m_style; }
|
||||
|
@ -45,9 +46,18 @@ public:
|
|||
callback(*node);
|
||||
}
|
||||
|
||||
template<typename Callback>
|
||||
inline void for_each_child(Callback callback)
|
||||
{
|
||||
for (auto* node = first_child(); node; node = node->next_sibling())
|
||||
callback(*node);
|
||||
}
|
||||
|
||||
virtual const char* class_name() const { return "LayoutNode"; }
|
||||
virtual bool is_text() const { return false; }
|
||||
|
||||
virtual void layout();
|
||||
|
||||
protected:
|
||||
explicit LayoutNode(const Node*);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue