2019-10-04 15:50:04 +02:00
|
|
|
#include <LibHTML/Frame.h>
|
2019-06-15 23:41:15 +02:00
|
|
|
#include <LibHTML/Layout/LayoutDocument.h>
|
2019-06-15 22:49:44 +02:00
|
|
|
|
2019-10-07 09:23:53 +02:00
|
|
|
LayoutDocument::LayoutDocument(const Document& document, NonnullRefPtr<StyleProperties> style)
|
|
|
|
: LayoutBlock(&document, move(style))
|
2019-06-15 22:49:44 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
LayoutDocument::~LayoutDocument()
|
|
|
|
{
|
|
|
|
}
|
2019-06-16 21:35:03 +02:00
|
|
|
|
|
|
|
void LayoutDocument::layout()
|
|
|
|
{
|
2019-10-04 15:50:04 +02:00
|
|
|
ASSERT(document().frame());
|
|
|
|
rect().set_width(document().frame()->size().width());
|
2019-09-25 12:29:25 +03:00
|
|
|
|
2019-06-16 21:35:03 +02:00
|
|
|
LayoutNode::layout();
|
2019-09-25 12:29:25 +03:00
|
|
|
|
|
|
|
int lowest_bottom = 0;
|
|
|
|
for_each_child([&](auto& child) {
|
|
|
|
if (child.rect().bottom() > lowest_bottom)
|
|
|
|
lowest_bottom = child.rect().bottom();
|
|
|
|
});
|
|
|
|
rect().set_bottom(lowest_bottom);
|
2019-06-16 21:35:03 +02:00
|
|
|
}
|