LibWeb: Use a standard x-macro to create FlyString ARIA attribute names

We are currently constructing the attribute names as FlyStrings every
time we invoke one of the ARIA attributes getters/setters. If there are
not any other instances of these strings in-memory, then we're thrashing
the FlyString cache.

Instead, let's follow suit of all other Web attributes - use an x-macro
to generate the attribute names.
This commit is contained in:
Timothy Flynn 2024-12-05 08:33:26 -05:00 committed by Tim Flynn
commit 4152870b85
Notes: github-actions[bot] 2024-12-05 17:10:40 +00:00
5 changed files with 105 additions and 224 deletions

View file

@ -0,0 +1,16 @@
/*
* Copyright (c) 2024, Tim Flynn <trflynn89@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/ARIA/AttributeNames.h>
namespace Web::ARIA::AttributeNames {
#define __ENUMERATE_ARIA_ATTRIBUTE(name, attribute) \
FlyString name = attribute##_fly_string;
ENUMERATE_ARIA_ATTRIBUTES
#undef __ENUMERATE_ARIA_ATTRIBUTE
}