mirror of
https://github.com/RGBCube/serenity
synced 2025-05-15 09:24:57 +00:00
LibWeb: Add Support for the ARIA Element Properties
Element now supports getting and setting ARIA properties from JS and HTML.
This commit is contained in:
parent
0a244b9c1f
commit
e63d9d4925
57 changed files with 976 additions and 1 deletions
|
@ -156,4 +156,18 @@ DeprecatedString const& HTMLSelectElement::type() const
|
|||
return select_multiple;
|
||||
}
|
||||
|
||||
FlyString HTMLSelectElement::default_role() const
|
||||
{
|
||||
// https://www.w3.org/TR/html-aria/#el-select-multiple-or-size-greater-1
|
||||
if (has_attribute("multiple"))
|
||||
return DOM::ARIARoleNames::listbox;
|
||||
if (has_attribute("size")) {
|
||||
auto size_attribute = attribute("size").to_int();
|
||||
if (size_attribute.has_value() && size_attribute.value() > 1)
|
||||
return DOM::ARIARoleNames::listbox;
|
||||
}
|
||||
// https://www.w3.org/TR/html-aria/#el-select
|
||||
return DOM::ARIARoleNames::combobox;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue