2019-06-27 15:47:59 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <AK/NonnullRefPtrVector.h>
|
2019-09-21 12:32:17 +00:00
|
|
|
#include <AK/OwnPtr.h>
|
|
|
|
#include <LibHTML/CSS/StyleProperties.h>
|
2019-06-27 15:47:59 +00:00
|
|
|
|
|
|
|
class Document;
|
|
|
|
class Element;
|
2019-06-28 19:17:34 +00:00
|
|
|
class ParentNode;
|
2019-06-27 18:40:21 +00:00
|
|
|
class StyleRule;
|
2019-06-27 15:47:59 +00:00
|
|
|
class StyleSheet;
|
|
|
|
|
|
|
|
class StyleResolver {
|
|
|
|
public:
|
|
|
|
explicit StyleResolver(Document&);
|
|
|
|
~StyleResolver();
|
|
|
|
|
|
|
|
Document& document() { return m_document; }
|
|
|
|
const Document& document() const { return m_document; }
|
|
|
|
|
2019-10-07 07:23:53 +00:00
|
|
|
NonnullRefPtr<StyleProperties> resolve_style(const Element&, const StyleProperties* parent_style) const;
|
2019-06-27 15:47:59 +00:00
|
|
|
|
2019-06-27 18:40:21 +00:00
|
|
|
NonnullRefPtrVector<StyleRule> collect_matching_rules(const Element&) const;
|
|
|
|
|
2019-10-05 21:47:06 +00:00
|
|
|
static bool is_inherited_property(const StringView&);
|
|
|
|
|
2019-06-27 15:47:59 +00:00
|
|
|
private:
|
2019-10-05 07:01:12 +00:00
|
|
|
template<typename Callback>
|
|
|
|
void for_each_stylesheet(Callback) const;
|
|
|
|
|
2019-06-27 15:47:59 +00:00
|
|
|
Document& m_document;
|
|
|
|
};
|