1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:48:12 +00:00

LibWeb: Port AttributeNames to FlyString

This commit is contained in:
Shannon Booth 2023-10-08 11:42:00 +13:00 committed by Tim Flynn
parent 6a3f27509f
commit e4f8c59210
93 changed files with 148 additions and 149 deletions

View file

@ -9,7 +9,7 @@
namespace Web::HTML {
namespace AttributeNames {
#define __ENUMERATE_HTML_ATTRIBUTE(name) DeprecatedFlyString name;
#define __ENUMERATE_HTML_ATTRIBUTE(name) FlyString name;
ENUMERATE_HTML_ATTRIBUTES
#undef __ENUMERATE_HTML_ATTRIBUTE
@ -19,19 +19,19 @@ void initialize_strings()
VERIFY(!s_initialized);
#define __ENUMERATE_HTML_ATTRIBUTE(name) \
name = #name;
name = #name##_fly_string;
ENUMERATE_HTML_ATTRIBUTES
#undef __ENUMERATE_HTML_ATTRIBUTE
// NOTE: Special cases for C++ keywords.
class_ = "class";
for_ = "for";
default_ = "default";
char_ = "char";
class_ = "class"_fly_string;
for_ = "for"_fly_string;
default_ = "default"_fly_string;
char_ = "char"_fly_string;
// NOTE: Special cases for attributes with dashes in them.
accept_charset = "accept-charset";
http_equiv = "http-equiv";
accept_charset = "accept-charset"_fly_string;
http_equiv = "http-equiv"_fly_string;
s_initialized = true;
}
@ -39,7 +39,7 @@ void initialize_strings()
}
// https://html.spec.whatwg.org/#boolean-attribute
bool is_boolean_attribute(DeprecatedFlyString const& attribute)
bool is_boolean_attribute(FlyString const& attribute)
{
// NOTE: This is the list of attributes from https://html.spec.whatwg.org/#attributes-3
// with a Value column value of "Boolean attribute".