mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibWeb: Add an SVG::AttributeNames namespace
There are a whole bunch of SVG attributes, and we shouldn't mix them in with the HTML attributes. This patch adds some of them to the new namespace, but there are more to be added. :^)
This commit is contained in:
29
Userland/Libraries/LibWeb/SVG/AttributeNames.cpp
Normal file
29
Userland/Libraries/LibWeb/SVG/AttributeNames.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/SVG/AttributeNames.h>
|
||||
|
||||
namespace Web::SVG::AttributeNames {
|
||||
|
||||
#define __ENUMERATE_SVG_ATTRIBUTE(name) FlyString name;
|
||||
ENUMERATE_SVG_ATTRIBUTES(__ENUMERATE_SVG_ATTRIBUTE)
|
||||
#undef __ENUMERATE_SVG_ATTRIBUTE
|
||||
|
||||
[[gnu::constructor]] static void initialize()
|
||||
{
|
||||
static bool s_initialized = false;
|
||||
if (s_initialized)
|
||||
return;
|
||||
|
||||
#define __ENUMERATE_SVG_ATTRIBUTE(name) \
|
||||
name = #name;
|
||||
ENUMERATE_SVG_ATTRIBUTES(__ENUMERATE_SVG_ATTRIBUTE)
|
||||
#undef __ENUMERATE_SVG_ATTRIBUTE
|
||||
|
||||
s_initialized = true;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user