LibWeb: Implement element-referencing ARIA attributes

There are ARIA attributes, e.g. ariaControlsElements, which refer to a
list of elements by their ID. For example:

    <div aria-controls="item1 item2">

The div.ariaControlsElements attribute would be a list of elements whose
ID matches the values in the aria-controls attribute.
This commit is contained in:
Timothy Flynn 2025-04-24 13:41:12 -04:00 committed by Tim Ledbetter
commit f985ac8884
Notes: github-actions[bot] 2025-04-25 00:21:23 +00:00
9 changed files with 3354 additions and 28 deletions

View file

@ -230,4 +230,17 @@ Vector<String> ARIAMixin::parse_id_reference_list(Optional<String> const& id_lis
return result;
}
#define __ENUMERATE_ARIA_ATTRIBUTE(attribute, referencing_attribute) \
Optional<Vector<WeakPtr<DOM::Element>>> const& ARIAMixin::attribute() const \
{ \
return m_##attribute; \
} \
\
void ARIAMixin::set_##attribute(Optional<Vector<WeakPtr<DOM::Element>>> value) \
{ \
m_##attribute = move(value); \
}
ENUMERATE_ARIA_ELEMENT_LIST_REFERENCING_ATTRIBUTES
#undef __ENUMERATE_ARIA_ATTRIBUTE
}