mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 19:37:35 +00:00
LibHTML: Refactor to go from DOM -> styled tree -> layout tree.
Frame::layout() drives everything now, it takes the DOM contained in the frame and puts it through the tree transformations.
This commit is contained in:
parent
6e95b11395
commit
7eef69ad4b
20 changed files with 132 additions and 131 deletions
|
@ -1,18 +1,27 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/AKString.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;
|
||||
|
||||
virtual RefPtr<LayoutNode> create_layout_node() override;
|
||||
StyleResolver& style_resolver();
|
||||
|
||||
void build_layout_tree();
|
||||
void add_sheet(const StyleSheet& sheet) { m_sheets.append(sheet); }
|
||||
const NonnullRefPtrVector<StyleSheet>& stylesheets() const { return m_sheets; }
|
||||
|
||||
private:
|
||||
OwnPtr<StyleResolver> m_style_resolver;
|
||||
NonnullRefPtrVector<StyleSheet> m_sheets;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue