LibWeb: Make ARIAMixin::to_element return a reference

Let's avoid confusion on whether this method can return null. It can't.
This also adds a non-const override, as that will be needed soon.
This commit is contained in:
Timothy Flynn 2025-04-24 11:18:07 -04:00 committed by Tim Ledbetter
commit a7b1f2c800
Notes: github-actions[bot] 2025-04-25 00:21:34 +00:00
3 changed files with 18 additions and 16 deletions

View file

@ -28,7 +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 {}; }
virtual DOM::Element& to_element() = 0;
virtual DOM::Element const& to_element() const = 0;
Optional<Role> role_from_role_attribute_value() const;
Optional<Role> role_or_default() const;