mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 19:38:12 +00:00
LibHTML: Start fleshing out a StyleResolver class.
This will be responsible for matching selectors and creating LayoutStyle objects for the document and its elements.
This commit is contained in:
parent
2282e89d3f
commit
2b4eea5a50
4 changed files with 58 additions and 0 deletions
28
LibHTML/CSS/StyleResolver.h
Normal file
28
LibHTML/CSS/StyleResolver.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <AK/NonnullRefPtrVector.h>
|
||||
#include <LibHTML/Layout/LayoutStyle.h>
|
||||
|
||||
class Document;
|
||||
class Element;
|
||||
class StyleSheet;
|
||||
|
||||
class StyleResolver {
|
||||
public:
|
||||
explicit StyleResolver(Document&);
|
||||
~StyleResolver();
|
||||
|
||||
Document& document() { return m_document; }
|
||||
const Document& document() const { return m_document; }
|
||||
|
||||
void add_sheet(const StyleSheet& sheet) { m_sheets.append(sheet); }
|
||||
|
||||
OwnPtr<LayoutStyle> resolve_element_style(const Element&);
|
||||
OwnPtr<LayoutStyle> resolve_document_style(const Document&);
|
||||
|
||||
private:
|
||||
Document& m_document;
|
||||
|
||||
NonnullRefPtrVector<StyleSheet> m_sheets;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue