LibWeb: Make [resolve,inherit]_counters() take AbstractElement

This is one of those cases where the spec says "element" and
means "element or pseudo-element". The easiest way to handle both is to
make these be free functions that take an AbstractElement, and then
give AbstractElement some helper methods so that the caller doesn't
have to care which it's dealing with.

There are some FIXMEs here because PseudoElement doesn't have a
CountersSet yet, and because the CountersSet currently uses a
UniqueNodeID to identify counter sources, which doesn't support
pseudo-elements.
This commit is contained in:
Sam Atkins 2025-06-18 10:28:56 +01:00
commit a57595faf5
Notes: github-actions[bot] 2025-06-19 11:37:37 +00:00
5 changed files with 117 additions and 103 deletions

View file

@ -418,10 +418,9 @@ public:
bool rendered_in_top_layer() const { return m_rendered_in_top_layer; }
bool has_non_empty_counters_set() const { return m_counters_set; }
Optional<CSS::CountersSet const&> counters_set();
Optional<CSS::CountersSet const&> counters_set() const;
CSS::CountersSet& ensure_counters_set();
void resolve_counters(CSS::ComputedProperties&);
void inherit_counters();
void set_counters_set(OwnPtr<CSS::CountersSet>&&);
ProximityToTheViewport proximity_to_the_viewport() const { return m_proximity_to_the_viewport; }
void determine_proximity_to_the_viewport();