2019-06-27 12:47:59 -03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <AK/NonnullRefPtrVector.h>
|
2019-09-21 09:32:17 -03:00
|
|
|
#include <AK/OwnPtr.h>
|
|
|
|
|
#include <LibHTML/CSS/StyleProperties.h>
|
2019-06-27 12:47:59 -03:00
|
|
|
|
|
|
|
|
class Document;
|
|
|
|
|
class Element;
|
2019-06-28 16:17:34 -03:00
|
|
|
class ParentNode;
|
2019-06-27 15:40:21 -03:00
|
|
|
class StyleRule;
|
2019-06-27 12:47:59 -03: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 04:23:53 -03:00
|
|
|
NonnullRefPtr<StyleProperties> resolve_style(const Element&, const StyleProperties* parent_style) const;
|
2019-06-27 12:47:59 -03:00
|
|
|
|
2019-06-27 15:40:21 -03:00
|
|
|
NonnullRefPtrVector<StyleRule> collect_matching_rules(const Element&) const;
|
|
|
|
|
|
2019-10-08 10:34:19 -03:00
|
|
|
static bool is_inherited_property(CSS::PropertyID);
|
2019-10-05 18:47:06 -03:00
|
|
|
|
2019-06-27 12:47:59 -03:00
|
|
|
private:
|
2019-10-05 04:01:12 -03:00
|
|
|
template<typename Callback>
|
|
|
|
|
void for_each_stylesheet(Callback) const;
|
|
|
|
|
|
2019-06-27 12:47:59 -03:00
|
|
|
Document& m_document;
|
|
|
|
|
};
|