LayoutListItem.cpp 625 B

1234567891011121314151617181920212223242526
  1. #include <LibHTML/Layout/LayoutListItem.h>
  2. #include <LibHTML/Layout/LayoutListItemMarker.h>
  3. LayoutListItem::LayoutListItem(const Element& element, NonnullRefPtr<StyleProperties> style)
  4. : LayoutBlock(&element, move(style))
  5. {
  6. }
  7. LayoutListItem::~LayoutListItem()
  8. {
  9. }
  10. void LayoutListItem::layout()
  11. {
  12. LayoutBlock::layout();
  13. if (!m_marker) {
  14. m_marker = adopt(*new LayoutListItemMarker);
  15. if (first_child())
  16. m_marker->set_inline(first_child()->is_inline());
  17. append_child(*m_marker);
  18. }
  19. Rect marker_rect { x() - 8, y(), 4, height() };
  20. m_marker->set_rect(marker_rect);
  21. }