1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 18:25:06 +00:00
serenity/Libraries/LibHTML/DOM/Document.h
Andreas Kling 88de955073 LibHTML: Have Document track its hovered Node
This gets set from HtmlView::mousemove_event() at the moment.
2019-09-29 11:50:35 +02:00

36 lines
967 B
C++

#pragma once
#include <AK/String.h>
#include <AK/NonnullRefPtrVector.h>
#include <AK/OwnPtr.h>
#include <LibHTML/CSS/StyleResolver.h>
#include <LibHTML/CSS/StyleSheet.h>
#include <LibHTML/DOM/ParentNode.h>
class LayoutNode;
class StyleResolver;
class StyleSheet;
class Document : public ParentNode {
public:
Document();
virtual ~Document() override;
void normalize();
StyleResolver& style_resolver();
void add_sheet(const StyleSheet& sheet) { m_sheets.append(sheet); }
const NonnullRefPtrVector<StyleSheet>& stylesheets() const { return m_sheets; }
virtual String tag_name() const override { return "#document"; }
void set_hovered_node(Node* node) { m_hovered_node = node; }
Node* hovered_node() { return m_hovered_node; }
const Node* hovered_node() const { return m_hovered_node; }
private:
OwnPtr<StyleResolver> m_style_resolver;
NonnullRefPtrVector<StyleSheet> m_sheets;
RefPtr<Node> m_hovered_node;
};