LayoutReplaced.cpp 634 B

1234567891011121314151617181920212223
  1. #include <LibHTML/DOM/Element.h>
  2. #include <LibHTML/Layout/LayoutBlock.h>
  3. #include <LibHTML/Layout/LayoutReplaced.h>
  4. LayoutReplaced::LayoutReplaced(const Element& element, NonnullRefPtr<StyleProperties> style)
  5. : LayoutNode(&element, move(style))
  6. {
  7. // FIXME: Allow non-inline replaced elements.
  8. set_inline(true);
  9. }
  10. LayoutReplaced::~LayoutReplaced()
  11. {
  12. }
  13. void LayoutReplaced::split_into_lines(LayoutBlock& container)
  14. {
  15. layout();
  16. if (container.line_boxes().is_empty())
  17. container.line_boxes().append(LineBox());
  18. container.line_boxes().last().add_fragment(*this, 0, 0, rect().width(), rect().height());
  19. }