Frame.cpp 603 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #include <LibHTML/DOM/Document.h>
  2. #include <LibHTML/Frame.h>
  3. Frame::Frame()
  4. {
  5. }
  6. Frame::~Frame()
  7. {
  8. }
  9. void Frame::set_document(Document* document)
  10. {
  11. if (m_document == document)
  12. return;
  13. if (m_document)
  14. m_document->detach_from_frame({}, *this);
  15. m_document = document;
  16. if (m_document)
  17. m_document->attach_to_frame({}, *this);
  18. }
  19. void Frame::set_size(const Size& size)
  20. {
  21. if (m_size == size)
  22. return;
  23. m_size = size;
  24. }
  25. void Frame::set_needs_display(const Rect& rect)
  26. {
  27. if (!on_set_needs_display)
  28. return;
  29. on_set_needs_display(rect);
  30. }