mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 09:09:43 +00:00
LibWeb/DOM: Give PseudoElement a CountersSet
This is not yet used
This commit is contained in:
parent
23520509cc
commit
67241d6419
Notes:
github-actions[bot]
2025-06-19 11:37:07 +00:00
Author: https://github.com/AtkinsSJ
Commit: 67241d6419
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5132
Reviewed-by: https://github.com/tcl3
2 changed files with 25 additions and 0 deletions
|
@ -23,4 +23,23 @@ void PseudoElement::visit_edges(JS::Cell::Visitor& visitor)
|
||||||
visitor.visit(m_layout_node);
|
visitor.visit(m_layout_node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Optional<CSS::CountersSet const&> PseudoElement::counters_set() const
|
||||||
|
{
|
||||||
|
if (!m_counters_set)
|
||||||
|
return {};
|
||||||
|
return *m_counters_set;
|
||||||
|
}
|
||||||
|
|
||||||
|
CSS::CountersSet& PseudoElement::ensure_counters_set()
|
||||||
|
{
|
||||||
|
if (!m_counters_set)
|
||||||
|
m_counters_set = make<CSS::CountersSet>();
|
||||||
|
return *m_counters_set;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PseudoElement::set_counters_set(OwnPtr<CSS::CountersSet>&& counters_set)
|
||||||
|
{
|
||||||
|
m_counters_set = move(counters_set);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,11 @@ class PseudoElement : public JS::Cell {
|
||||||
HashMap<FlyString, CSS::StyleProperty> const& custom_properties() const { return m_custom_properties; }
|
HashMap<FlyString, CSS::StyleProperty> const& custom_properties() const { return m_custom_properties; }
|
||||||
void set_custom_properties(HashMap<FlyString, CSS::StyleProperty> value) { m_custom_properties = move(value); }
|
void set_custom_properties(HashMap<FlyString, CSS::StyleProperty> value) { m_custom_properties = move(value); }
|
||||||
|
|
||||||
|
bool has_non_empty_counters_set() const { return m_counters_set; }
|
||||||
|
Optional<CSS::CountersSet const&> counters_set() const;
|
||||||
|
CSS::CountersSet& ensure_counters_set();
|
||||||
|
void set_counters_set(OwnPtr<CSS::CountersSet>&&);
|
||||||
|
|
||||||
virtual void visit_edges(JS::Cell::Visitor&) override;
|
virtual void visit_edges(JS::Cell::Visitor&) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -37,6 +42,7 @@ private:
|
||||||
GC::Ptr<CSS::CascadedProperties> m_cascaded_properties;
|
GC::Ptr<CSS::CascadedProperties> m_cascaded_properties;
|
||||||
GC::Ptr<CSS::ComputedProperties> m_computed_properties;
|
GC::Ptr<CSS::ComputedProperties> m_computed_properties;
|
||||||
HashMap<FlyString, CSS::StyleProperty> m_custom_properties;
|
HashMap<FlyString, CSS::StyleProperty> m_custom_properties;
|
||||||
|
OwnPtr<CSS::CountersSet> m_counters_set;
|
||||||
};
|
};
|
||||||
|
|
||||||
// https://drafts.csswg.org/css-view-transitions/#pseudo-element-tree
|
// https://drafts.csswg.org/css-view-transitions/#pseudo-element-tree
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue