2019-10-04 15:50:04 +02:00
|
|
|
#include <LibHTML/DOM/Document.h>
|
|
|
|
#include <LibHTML/Frame.h>
|
2019-11-25 21:19:03 +01:00
|
|
|
#include <LibHTML/HtmlView.h>
|
2019-10-04 15:50:04 +02:00
|
|
|
|
2019-11-25 21:19:03 +01:00
|
|
|
Frame::Frame(HtmlView& html_view)
|
|
|
|
: m_html_view(html_view.make_weak_ptr())
|
2019-10-04 15:50:04 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
Frame::~Frame()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void Frame::set_document(Document* document)
|
|
|
|
{
|
|
|
|
if (m_document == document)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (m_document)
|
|
|
|
m_document->detach_from_frame({}, *this);
|
|
|
|
|
|
|
|
m_document = document;
|
|
|
|
|
|
|
|
if (m_document)
|
|
|
|
m_document->attach_to_frame({}, *this);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Frame::set_size(const Size& size)
|
|
|
|
{
|
|
|
|
if (m_size == size)
|
|
|
|
return;
|
|
|
|
m_size = size;
|
|
|
|
}
|
2019-10-09 21:25:29 +02:00
|
|
|
|
|
|
|
void Frame::set_needs_display(const Rect& rect)
|
|
|
|
{
|
|
|
|
if (!on_set_needs_display)
|
|
|
|
return;
|
|
|
|
on_set_needs_display(rect);
|
|
|
|
}
|