mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-21 01:40:46 +00:00
LibWeb: Support the ariaActiveDescendantElement IDL attribute
This commit is contained in:
parent
e1b4aa94db
commit
1be55fe793
Notes:
github-actions[bot]
2025-01-01 11:01:48 +00:00
Author: https://github.com/sideshowbarker
Commit: 1be55fe793
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3085
Reviewed-by: https://github.com/tcl3 ✅
5 changed files with 890 additions and 0 deletions
|
@ -96,6 +96,7 @@ void Element::visit_edges(Cell::Visitor& visitor)
|
|||
SlottableMixin::visit_edges(visitor);
|
||||
Animatable::visit_edges(visitor);
|
||||
|
||||
visitor.visit(m_aria_active_descendant_element);
|
||||
visitor.visit(m_attributes);
|
||||
visitor.visit(m_inline_style);
|
||||
visitor.visit(m_class_list);
|
||||
|
@ -2926,6 +2927,10 @@ void Element::attribute_changed(FlyString const& local_name, Optional<String> co
|
|||
m_dir = Dir::Auto;
|
||||
else
|
||||
m_dir = {};
|
||||
} else if (local_name == ARIA::AttributeNames::aria_active_descendant) {
|
||||
// https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#reflecting-content-attributes-in-idl-attributes:concept-element-attributes-change-ext
|
||||
// Set element's explicitly set attr-element to null.
|
||||
m_aria_active_descendant_element = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -295,6 +295,9 @@ public:
|
|||
ENUMERATE_ARIA_ATTRIBUTES
|
||||
#undef __ENUMERATE_ARIA_ATTRIBUTE
|
||||
|
||||
GC::Ptr<DOM::Element> aria_active_descendant_element() { return m_aria_active_descendant_element; }
|
||||
void set_aria_active_descendant_element(GC::Ptr<DOM::Element> value) { m_aria_active_descendant_element = value; }
|
||||
|
||||
virtual bool exclude_from_accessibility_tree() const override;
|
||||
|
||||
virtual bool include_in_accessibility_tree() const override;
|
||||
|
@ -464,6 +467,8 @@ private:
|
|||
bool m_in_top_layer { false };
|
||||
|
||||
OwnPtr<CSS::CountersSet> m_counters_set;
|
||||
|
||||
GC::Ptr<DOM::Element> m_aria_active_descendant_element;
|
||||
};
|
||||
|
||||
template<>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue