LayoutDocument.cpp 555 B

123456789101112131415161718192021222324
  1. #include <LibHTML/Layout/LayoutDocument.h>
  2. LayoutDocument::LayoutDocument(const Document& document, StyleProperties&& style_properties)
  3. : LayoutBlock(&document, move(style_properties))
  4. {
  5. }
  6. LayoutDocument::~LayoutDocument()
  7. {
  8. }
  9. void LayoutDocument::layout()
  10. {
  11. rect().set_width(style().size().width());
  12. LayoutNode::layout();
  13. int lowest_bottom = 0;
  14. for_each_child([&](auto& child) {
  15. if (child.rect().bottom() > lowest_bottom)
  16. lowest_bottom = child.rect().bottom();
  17. });
  18. rect().set_bottom(lowest_bottom);
  19. }