1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:37:35 +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

@ -1345,7 +1345,7 @@ Messages::WebDriverClient::ElementClickResponse WebDriverConnection::element_cli
// 3. If elements container has the multiple attribute, toggle the elements selectedness state
// by setting it to the opposite value of its current selectedness.
if (parent_node.has_value() && parent_node->has_attribute("multiple")) {
if (parent_node.has_value() && parent_node->has_attribute(Web::HTML::AttributeNames::multiple)) {
option_element.set_selected(!option_element.selected());
}
// Otherwise, set the elements selectedness state to true.