1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 19:35:08 +00:00

LibWeb: Make Element attribute getters take a StringView

These functions are deferring to NamedNodeMap::get_attribute which
already takes a StringView. This changes also leads to finding some
places which were passing though a const char* instead of an entry from
Attribute names. Fix that where applicable, and switch to has_attribute
in some of those places instead of deprecated_attribute where
equivalent.

Ideally this should be taking a 'FlyString const&', but to continue
porting away from DeprecatedString, just leave a FIXME for now.
This commit is contained in:
Shannon Booth 2023-09-21 21:22:56 +12:00 committed by Andreas Kling
parent dbf8ff64fb
commit 47514e07b4
6 changed files with 64 additions and 63 deletions

View file

@ -167,7 +167,7 @@ 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("size").to_int();
auto size_attribute = deprecated_attribute(AttributeNames::size).to_int();
if (size_attribute.has_value() && size_attribute.value() > 1)
return ARIA::Role::listbox;
}