mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-28 23:39:02 +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:
parent
dbf8ff64fb
commit
47514e07b4
Notes:
sideshowbarker
2024-07-17 04:32:07 +09:00
Author: https://github.com/shannonbooth
Commit: 47514e07b4
Pull-request: https://github.com/SerenityOS/serenity/pull/21174
Reviewed-by: https://github.com/awesomekling
6 changed files with 64 additions and 63 deletions
|
@ -1088,7 +1088,7 @@ Optional<ARIA::Role> HTMLInputElement::default_role() const
|
|||
if (type_state() == TypeAttributeState::Checkbox)
|
||||
return ARIA::Role::checkbox;
|
||||
// https://www.w3.org/TR/html-aria/#el-input-email
|
||||
if (type_state() == TypeAttributeState::Email && deprecated_attribute("list").is_null())
|
||||
if (type_state() == TypeAttributeState::Email && !has_attribute(AttributeNames::list))
|
||||
return ARIA::Role::textbox;
|
||||
// https://www.w3.org/TR/html-aria/#el-input-image
|
||||
if (type_state() == TypeAttributeState::ImageButton)
|
||||
|
@ -1111,10 +1111,10 @@ Optional<ARIA::Role> HTMLInputElement::default_role() const
|
|||
|| type_state() == TypeAttributeState::Telephone
|
||||
|| type_state() == TypeAttributeState::URL
|
||||
|| type_state() == TypeAttributeState::Email)
|
||||
&& !deprecated_attribute("list").is_null())
|
||||
&& has_attribute(AttributeNames::list))
|
||||
return ARIA::Role::combobox;
|
||||
// https://www.w3.org/TR/html-aria/#el-input-search
|
||||
if (type_state() == TypeAttributeState::Search && deprecated_attribute("list").is_null())
|
||||
if (type_state() == TypeAttributeState::Search && !has_attribute(AttributeNames::list))
|
||||
return ARIA::Role::textbox;
|
||||
// https://www.w3.org/TR/html-aria/#el-input-submit
|
||||
if (type_state() == TypeAttributeState::SubmitButton)
|
||||
|
@ -1123,10 +1123,10 @@ Optional<ARIA::Role> HTMLInputElement::default_role() const
|
|||
if (type_state() == TypeAttributeState::Telephone)
|
||||
return ARIA::Role::textbox;
|
||||
// https://www.w3.org/TR/html-aria/#el-input-text
|
||||
if (type_state() == TypeAttributeState::Text && deprecated_attribute("list").is_null())
|
||||
if (type_state() == TypeAttributeState::Text && !has_attribute(AttributeNames::list))
|
||||
return ARIA::Role::textbox;
|
||||
// https://www.w3.org/TR/html-aria/#el-input-url
|
||||
if (type_state() == TypeAttributeState::URL && deprecated_attribute("list").is_null())
|
||||
if (type_state() == TypeAttributeState::URL && !has_attribute(AttributeNames::list))
|
||||
return ARIA::Role::textbox;
|
||||
|
||||
// https://www.w3.org/TR/html-aria/#el-input-color
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue