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

@ -1,5 +1,5 @@
/*
* Copyright (c) 2024, Sam Atkins <sam@ladybird.org>
* Copyright (c) 2024-2025, Sam Atkins <sam@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -48,4 +48,7 @@ private:
Vector<Counter> m_counters;
};
void resolve_counters(DOM::AbstractElement&);
void inherit_counters(DOM::AbstractElement&);
}