mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 12:35:14 +00:00
LibWeb: Initialize tag/attribute name globals in init-time constructors
This commit is contained in:
parent
cdf1282419
commit
40f4ccc3ea
Notes:
sideshowbarker
2024-07-19 03:52:19 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/40f4ccc3ead
7 changed files with 3 additions and 13 deletions
|
@ -34,7 +34,7 @@ namespace AttributeNames {
|
|||
ENUMERATE_HTML_ATTRIBUTES
|
||||
#undef __ENUMERATE_HTML_ATTRIBUTE
|
||||
|
||||
void initialize()
|
||||
[[gnu::constructor]] static void initialize()
|
||||
{
|
||||
static bool s_initialized = false;
|
||||
if (s_initialized)
|
||||
|
|
|
@ -32,8 +32,6 @@ namespace Web {
|
|||
namespace HTML {
|
||||
namespace AttributeNames {
|
||||
|
||||
void initialize();
|
||||
|
||||
#define ENUMERATE_HTML_ATTRIBUTES \
|
||||
__ENUMERATE_HTML_ATTRIBUTE(abbr) \
|
||||
__ENUMERATE_HTML_ATTRIBUTE(accept) \
|
||||
|
|
|
@ -68,10 +68,6 @@ Document::Document(const URL& url)
|
|||
, m_url(url)
|
||||
, m_window(Window::create_with_document(*this))
|
||||
{
|
||||
HTML::AttributeNames::initialize();
|
||||
HTML::TagNames::initialize();
|
||||
SVG::TagNames::initialize();
|
||||
|
||||
m_style_update_timer = Core::Timer::create_single_shot(0, [this] {
|
||||
update_style();
|
||||
});
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace TagNames {
|
|||
ENUMERATE_HTML_TAGS
|
||||
#undef __ENUMERATE_HTML_TAG
|
||||
|
||||
void initialize()
|
||||
[[gnu::constructor]] static void initialize()
|
||||
{
|
||||
static bool s_initialized = false;
|
||||
if (s_initialized)
|
||||
|
|
|
@ -32,8 +32,6 @@ namespace Web {
|
|||
namespace HTML {
|
||||
namespace TagNames {
|
||||
|
||||
void initialize();
|
||||
|
||||
#define ENUMERATE_HTML_TAGS \
|
||||
__ENUMERATE_HTML_TAG(a) \
|
||||
__ENUMERATE_HTML_TAG(abbr) \
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace Web::SVG::TagNames {
|
|||
ENUMERATE_SVG_TAGS
|
||||
#undef __ENUMERATE_SVG_TAG
|
||||
|
||||
void initialize()
|
||||
[[gnu::constructor]] static void initialize()
|
||||
{
|
||||
static bool s_initialized = false;
|
||||
if (s_initialized)
|
||||
|
|
|
@ -30,8 +30,6 @@
|
|||
|
||||
namespace Web::SVG::TagNames {
|
||||
|
||||
void initialize();
|
||||
|
||||
#define ENUMERATE_SVG_GRAPHICS_TAGS \
|
||||
__ENUMERATE_SVG_TAG(svg) \
|
||||
__ENUMERATE_SVG_TAG(path) \
|
||||
|
|
Loading…
Add table
Reference in a new issue