mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 22:17:42 +00:00
LibHTML: Flesh out the code to dump a StyleSheet object graph.
This commit is contained in:
parent
048705e1c2
commit
6469d7f043
3 changed files with 42 additions and 1 deletions
|
@ -13,6 +13,16 @@ public:
|
|||
|
||||
~StyleRule();
|
||||
|
||||
const Vector<Selector>& selectors() const { return m_selectors; }
|
||||
const Vector<NonnullRefPtr<StyleDeclaration>>& declarations() const { return m_declarations; }
|
||||
|
||||
template<typename C>
|
||||
void for_each_declaration(C callback) const
|
||||
{
|
||||
for (auto& declaration : m_declarations)
|
||||
callback(*declaration);
|
||||
}
|
||||
|
||||
private:
|
||||
StyleRule(Vector<Selector>&&, Vector<NonnullRefPtr<StyleDeclaration>>&&);
|
||||
|
||||
|
|
|
@ -20,6 +20,8 @@ public:
|
|||
|
||||
Type type() const { return m_type; }
|
||||
|
||||
virtual String to_string() const = 0;
|
||||
|
||||
protected:
|
||||
explicit StyleValue(Type);
|
||||
|
||||
|
@ -36,7 +38,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
String to_string() const { return m_string; }
|
||||
String to_string() const override { return m_string; }
|
||||
|
||||
private:
|
||||
String m_string;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue