mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:47:34 +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
|
@ -3,10 +3,12 @@
|
|||
#include <AK/NonnullRefPtrVector.h>
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/WeakPtr.h>
|
||||
#include <LibHTML/CSS/StyleResolver.h>
|
||||
#include <LibHTML/CSS/StyleSheet.h>
|
||||
#include <LibHTML/DOM/ParentNode.h>
|
||||
|
||||
class Frame;
|
||||
class HTMLHtmlElement;
|
||||
class HTMLHeadElement;
|
||||
class LayoutNode;
|
||||
|
@ -36,8 +38,15 @@ public:
|
|||
|
||||
String title() const;
|
||||
|
||||
void attach_to_frame(Badge<Frame>, Frame&);
|
||||
void detach_from_frame(Badge<Frame>, Frame&);
|
||||
|
||||
Frame* frame() { return m_frame.ptr(); }
|
||||
const Frame* frame() const { return m_frame.ptr(); }
|
||||
|
||||
private:
|
||||
OwnPtr<StyleResolver> m_style_resolver;
|
||||
NonnullRefPtrVector<StyleSheet> m_sheets;
|
||||
RefPtr<Node> m_hovered_node;
|
||||
WeakPtr<Frame> m_frame;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue