mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-12 19:19:30 +00:00
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:
parent
0289df9357
commit
f985ac8884
Notes:
github-actions[bot]
2025-04-25 00:21:23 +00:00
Author: https://github.com/trflynn89
Commit: f985ac8884
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4460
Reviewed-by: https://github.com/tcl3 ✅
9 changed files with 3354 additions and 28 deletions
|
@ -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
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue