mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-19 07:33:20 +00:00
LibWeb: Implement ariaActiveDescendantElement spiritually closer to spec
We are meant to store a weak reference to the element indicated by this attribute, rather than a GC-protected strong reference. This also hoists the "get the attr-associated element" AO into its own function, rather than being hidden in IDL, to match "get the attr-associated elements".
This commit is contained in:
parent
f985ac8884
commit
13ac6c4fde
Notes:
github-actions[bot]
2025-04-25 00:21:14 +00:00
Author: https://github.com/trflynn89
Commit: 13ac6c4fde
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4460
Reviewed-by: https://github.com/tcl3 ✅
5 changed files with 87 additions and 67 deletions
|
@ -14,11 +14,6 @@ namespace Web::ARIA {
|
|||
ARIAMixin::ARIAMixin() = default;
|
||||
ARIAMixin::~ARIAMixin() = default;
|
||||
|
||||
void ARIAMixin::visit_edges(GC::Cell::Visitor& visitor)
|
||||
{
|
||||
visitor.visit(m_aria_active_descendant_element);
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/wai-aria-1.2/#introroles
|
||||
Optional<Role> ARIAMixin::role_from_role_attribute_value() const
|
||||
{
|
||||
|
@ -230,6 +225,19 @@ Vector<String> ARIAMixin::parse_id_reference_list(Optional<String> const& id_lis
|
|||
return result;
|
||||
}
|
||||
|
||||
#define __ENUMERATE_ARIA_ATTRIBUTE(attribute, referencing_attribute) \
|
||||
GC::Ptr<DOM::Element> ARIAMixin::attribute() const \
|
||||
{ \
|
||||
return m_##attribute.ptr(); \
|
||||
} \
|
||||
\
|
||||
void ARIAMixin::set_##attribute(GC::Ptr<DOM::Element> value) \
|
||||
{ \
|
||||
m_##attribute = value.ptr(); \
|
||||
}
|
||||
ENUMERATE_ARIA_ELEMENT_REFERENCING_ATTRIBUTES
|
||||
#undef __ENUMERATE_ARIA_ATTRIBUTE
|
||||
|
||||
#define __ENUMERATE_ARIA_ATTRIBUTE(attribute, referencing_attribute) \
|
||||
Optional<Vector<WeakPtr<DOM::Element>>> const& ARIAMixin::attribute() const \
|
||||
{ \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue