LibWeb: Make Element::has_attribute take a StringView

It calls Element::get_attribute which takes a StringView. Ultimately,
this should be taking a FlyString, but to help in porting away from
DeprecatedString, just leave a FIXME for that for now.
This commit is contained in:
Shannon Booth 2023-09-21 20:26:19 +12:00 committed by Andreas Kling
parent 52fccae654
commit 79f97da4b4
Notes: sideshowbarker 2024-07-16 20:05:14 +09:00
5 changed files with 8 additions and 5 deletions

View file

@ -164,9 +164,9 @@ String const& HTMLSelectElement::type() const
Optional<ARIA::Role> HTMLSelectElement::default_role() const
{
// https://www.w3.org/TR/html-aria/#el-select-multiple-or-size-greater-1
if (has_attribute("multiple"))
if (has_attribute(AttributeNames::multiple))
return ARIA::Role::listbox;
if (has_attribute("size")) {
if (has_attribute(AttributeNames::size)) {
auto size_attribute = deprecated_attribute("size").to_int();
if (size_attribute.has_value() && size_attribute.value() > 1)
return ARIA::Role::listbox;