LibWeb: Remove DOM element deprecated_get_attribute()

This commit is contained in:
Bastiaan van der Plaat 2024-01-16 19:04:45 +01:00 committed by Andrew Kaster
parent c477f90df7
commit a681429dff
Notes: sideshowbarker 2024-07-17 18:49:10 +09:00
40 changed files with 114 additions and 122 deletions

View file

@ -193,9 +193,10 @@ Optional<ARIA::Role> HTMLSelectElement::default_role() const
if (has_attribute(AttributeNames::multiple))
return ARIA::Role::listbox;
if (has_attribute(AttributeNames::size)) {
auto size_attribute = deprecated_attribute(AttributeNames::size).to_number<int>();
if (size_attribute.has_value() && size_attribute.value() > 1)
return ARIA::Role::listbox;
if (auto size_string = get_attribute(HTML::AttributeNames::size); size_string.has_value()) {
if (auto size = size_string->to_number<int>(); size.has_value() && *size > 1)
return ARIA::Role::listbox;
}
}
// https://www.w3.org/TR/html-aria/#el-select
return ARIA::Role::combobox;