mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 12:49:19 +00:00
LibWeb: Port AttributeNames to FlyString
This commit is contained in:
parent
6a3f27509f
commit
e4f8c59210
Notes:
sideshowbarker
2024-07-18 04:46:35 +09:00
Author: https://github.com/shannonbooth
Commit: e4f8c59210
Pull-request: https://github.com/SerenityOS/serenity/pull/21376
93 changed files with 148 additions and 149 deletions
|
@ -1064,18 +1064,16 @@ Messages::WebDriverClient::GetElementAttributeResponse WebDriverConnection::get_
|
|||
// 4. Let result be the result of the first matching condition:
|
||||
Optional<DeprecatedString> result;
|
||||
|
||||
auto deprecated_name = name.to_deprecated_string();
|
||||
|
||||
// -> If name is a boolean attribute
|
||||
if (Web::HTML::is_boolean_attribute(deprecated_name)) {
|
||||
if (Web::HTML::is_boolean_attribute(name)) {
|
||||
// "true" (string) if the element has the attribute, otherwise null.
|
||||
if (element->has_attribute(deprecated_name))
|
||||
if (element->has_attribute(name))
|
||||
result = "true"sv;
|
||||
}
|
||||
// -> Otherwise
|
||||
else {
|
||||
// The result of getting an attribute by name name.
|
||||
result = element->deprecated_get_attribute(deprecated_name);
|
||||
result = element->deprecated_get_attribute(name);
|
||||
}
|
||||
|
||||
// 5. Return success with data result.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue