mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
LibWeb: Add a to_element function to ARIAMixin
This change adds a virtual to_element function to ARIAMixin, and overrides it in DOM::Element so it can then be used back inside ARIAMixin to get an element when needed (for example, when computing a role requires checking the roles of ancestors of an element).
This commit is contained in:
parent
81d6cd497a
commit
9f01eebff3
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include <LibWeb/ARIA/ARIAMixin.h>
|
||||
#include <LibWeb/ARIA/Roles.h>
|
||||
#include <LibWeb/DOM/Element.h>
|
||||
#include <LibWeb/Infra/CharacterTypes.h>
|
||||
|
||||
namespace Web::ARIA {
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ public:
|
|||
// https://www.w3.org/TR/html-aria/#docconformance
|
||||
virtual Optional<Role> default_role() const { return {}; }
|
||||
|
||||
virtual DOM::Element const* to_element() const { return {}; }
|
||||
|
||||
Optional<Role> role_from_role_attribute_value() const;
|
||||
Optional<Role> role_or_default() const;
|
||||
|
||||
|
|
|
|||
|
|
@ -315,6 +315,8 @@ public:
|
|||
|
||||
virtual bool include_in_accessibility_tree() const override;
|
||||
|
||||
virtual Element const* to_element() const override { return this; }
|
||||
|
||||
bool is_hidden() const;
|
||||
bool has_hidden_ancestor() const;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user