mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-07 10:06:03 +00:00
LibWeb: Extract ARIA role-attribute checking out from role_or_default()
This change separates the steps for checking the string value of the ARIA “role” attribute out from the element.role_or_default() function into a separate function — in order to expose a way to just check if the ARIA “role” attribute actually has a value, without also then computing a default role value if no “role” attribute value was found. Otherwise, without this change, the only available function for retrieving ARIA role values is the element.role_or_default() function — which always does the additional step of computing (and returning) a default role value if no “role” attribute is found.
This commit is contained in:
parent
c5966bbdcb
commit
7a4a9cc7bc
Notes:
github-actions[bot]
2024-12-06 18:32:48 +00:00
Author: https://github.com/sideshowbarker
Commit: 7a4a9cc7bc
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2779
Reviewed-by: https://github.com/tcl3 ✅
2 changed files with 10 additions and 2 deletions
|
@ -28,6 +28,7 @@ public:
|
|||
// https://www.w3.org/TR/html-aria/#docconformance
|
||||
virtual Optional<Role> default_role() const { return {}; }
|
||||
|
||||
Optional<Role> role_from_role_attribute_value() const;
|
||||
Optional<Role> role_or_default() const;
|
||||
|
||||
// https://www.w3.org/TR/wai-aria-1.2/#tree_exclusion
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue