1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-02 23:22:07 +00:00

LibHTML: Add a Frame class and use it for document layout width

Each HtmlView now has a main_frame(), which represents the main frame
of the web page. Frame inherits from TreeNode<Frame>, which will allow
us to someday implement a Frame tree (to support the <frame> element.)
This commit is contained in:
Andreas Kling 2019-10-04 15:50:04 +02:00
parent b1758ae2b3
commit 7bc9310170
9 changed files with 101 additions and 8 deletions

View file

@ -4,6 +4,7 @@
#include <LibHTML/DOM/HTMLHeadElement.h>
#include <LibHTML/DOM/HTMLHtmlElement.h>
#include <LibHTML/DOM/HTMLTitleElement.h>
#include <LibHTML/Frame.h>
#include <LibHTML/Layout/LayoutDocument.h>
#include <stdio.h>
@ -63,3 +64,12 @@ String Document::title() const
return title_element->text_content();
}
void Document::attach_to_frame(Badge<Frame>, Frame& frame)
{
m_frame = frame.make_weak_ptr();
}
void Document::detach_from_frame(Badge<Frame>, Frame&)
{
}