LibWeb: Compute accessible names for hidden/hidden-but-referenced nodes

This change implements full support for the “A. Hidden Not Referenced”
step at https://w3c.github.io/accname/#step2A in the “Accessible Name
and Description Computation” spec — including handling all hidden nodes
that must be ignored, as well as handling hidden nodes that, for the
purposes of accessible-name computation, must not be ignored (due to
having aria-labelledby/aria-describedby references from other nodes).

Otherwise, without this change, not all cases of hidden nodes get
ignored as expected, while cases of nodes that are hidden but that have
aria-labelledby/aria-describedby references from other nodes get
unexpectedly ignored.
This commit is contained in:
sideshowbarker 2024-11-11 16:21:05 +09:00 committed by Sam Atkins
commit 314e5d6bb7
Notes: github-actions[bot] 2024-11-29 12:19:31 +00:00
7 changed files with 489 additions and 21 deletions

View file

@ -348,6 +348,12 @@ public:
virtual bool include_in_accessibility_tree() const override;
bool is_hidden() const;
bool has_hidden_ancestor() const;
bool is_referenced() const;
bool has_referenced_and_hidden_ancestor() const;
void enqueue_a_custom_element_upgrade_reaction(HTML::CustomElementDefinition& custom_element_definition);
void enqueue_a_custom_element_callback_reaction(FlyString const& callback_name, GC::MarkedVector<JS::Value> arguments);