mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-01 08:48:49 +00:00
LibWeb: Remove DOM element deprecated_get_attribute()
This commit is contained in:
parent
c477f90df7
commit
a681429dff
Notes:
sideshowbarker
2024-07-17 18:49:10 +09:00
Author: https://github.com/bplaat
Commit: a681429dff
Pull-request: https://github.com/SerenityOS/serenity/pull/22777
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/shannonbooth ✅
40 changed files with 114 additions and 122 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue