mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 02:17:35 +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:
parent
b1758ae2b3
commit
7bc9310170
9 changed files with 101 additions and 8 deletions
|
@ -1,3 +1,4 @@
|
|||
#include <LibHTML/Frame.h>
|
||||
#include <LibHTML/Layout/LayoutDocument.h>
|
||||
|
||||
LayoutDocument::LayoutDocument(const Document& document, NonnullRefPtr<StyleProperties> style_properties)
|
||||
|
@ -11,7 +12,8 @@ LayoutDocument::~LayoutDocument()
|
|||
|
||||
void LayoutDocument::layout()
|
||||
{
|
||||
rect().set_width(style().size().width());
|
||||
ASSERT(document().frame());
|
||||
rect().set_width(document().frame()->size().width());
|
||||
|
||||
LayoutNode::layout();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue