mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-29 07:48:47 +00:00
LibWeb: Assign ARIA role “switch” to <input type=checkbox switch>
This commit is contained in:
parent
18132a0be1
commit
0a2aa87107
Notes:
github-actions[bot]
2024-12-09 08:48:26 +00:00
Author: https://github.com/sideshowbarker
Commit: 0a2aa87107
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2846
Reviewed-by: https://github.com/gmta ✅
3 changed files with 73 additions and 1 deletions
|
@ -2355,8 +2355,12 @@ Optional<ARIA::Role> HTMLInputElement::default_role() const
|
|||
if (type_state() == TypeAttributeState::Button)
|
||||
return ARIA::Role::button;
|
||||
// https://www.w3.org/TR/html-aria/#el-input-checkbox
|
||||
if (type_state() == TypeAttributeState::Checkbox)
|
||||
if (type_state() == TypeAttributeState::Checkbox) {
|
||||
// https://github.com/w3c/html-aam/issues/496
|
||||
if (has_attribute("switch"_string))
|
||||
return ARIA::Role::switch_;
|
||||
return ARIA::Role::checkbox;
|
||||
}
|
||||
// https://www.w3.org/TR/html-aria/#el-input-email
|
||||
if (type_state() == TypeAttributeState::Email && !has_attribute(AttributeNames::list))
|
||||
return ARIA::Role::textbox;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue