mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:38:11 +00:00
LibWeb: Add Web::XLink::AttributeNames
As defined by the XLink spec.
This commit is contained in:
parent
e5d45eeeb1
commit
c4efc0a5aa
4 changed files with 63 additions and 0 deletions
|
@ -49,6 +49,7 @@
|
||||||
#include <LibWeb/WebGL/EventNames.h>
|
#include <LibWeb/WebGL/EventNames.h>
|
||||||
#include <LibWeb/WebIDL/AbstractOperations.h>
|
#include <LibWeb/WebIDL/AbstractOperations.h>
|
||||||
#include <LibWeb/XHR/EventNames.h>
|
#include <LibWeb/XHR/EventNames.h>
|
||||||
|
#include <LibWeb/XLink/AttributeNames.h>
|
||||||
|
|
||||||
namespace Web::Bindings {
|
namespace Web::Bindings {
|
||||||
|
|
||||||
|
@ -99,6 +100,7 @@ ErrorOr<void> initialize_main_thread_vm()
|
||||||
UIEvents::EventNames::initialize_strings();
|
UIEvents::EventNames::initialize_strings();
|
||||||
WebGL::EventNames::initialize_strings();
|
WebGL::EventNames::initialize_strings();
|
||||||
XHR::EventNames::initialize_strings();
|
XHR::EventNames::initialize_strings();
|
||||||
|
XLink::AttributeNames::initialize_strings();
|
||||||
|
|
||||||
static_cast<WebEngineCustomData*>(s_main_thread_vm->custom_data())->event_loop.set_vm(*s_main_thread_vm);
|
static_cast<WebEngineCustomData*>(s_main_thread_vm->custom_data())->event_loop.set_vm(*s_main_thread_vm);
|
||||||
|
|
||||||
|
|
|
@ -624,6 +624,7 @@ set(SOURCES
|
||||||
XHR/XMLHttpRequestEventTarget.cpp
|
XHR/XMLHttpRequestEventTarget.cpp
|
||||||
XHR/XMLHttpRequestUpload.cpp
|
XHR/XMLHttpRequestUpload.cpp
|
||||||
XML/XMLDocumentBuilder.cpp
|
XML/XMLDocumentBuilder.cpp
|
||||||
|
XLink/AttributeNames.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
invoke_generator(
|
invoke_generator(
|
||||||
|
|
28
Userland/Libraries/LibWeb/XLink/AttributeNames.cpp
Normal file
28
Userland/Libraries/LibWeb/XLink/AttributeNames.cpp
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2023, Shannon Booth <shannon@serenityos.org>
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <LibWeb/XLink/AttributeNames.h>
|
||||||
|
|
||||||
|
namespace Web::XLink::AttributeNames {
|
||||||
|
|
||||||
|
#define __ENUMERATE_XLINK_ATTRIBUTE(name) FlyString name;
|
||||||
|
ENUMERATE_XLINK_ATTRIBUTES(__ENUMERATE_XLINK_ATTRIBUTE)
|
||||||
|
#undef __ENUMERATE_XLINK_ATTRIBUTE
|
||||||
|
|
||||||
|
void initialize_strings()
|
||||||
|
{
|
||||||
|
static bool s_initialized = false;
|
||||||
|
VERIFY(!s_initialized);
|
||||||
|
|
||||||
|
#define __ENUMERATE_XLINK_ATTRIBUTE(name) \
|
||||||
|
name = #name##_fly_string;
|
||||||
|
ENUMERATE_XLINK_ATTRIBUTES(__ENUMERATE_XLINK_ATTRIBUTE)
|
||||||
|
#undef __ENUMERATE_XLINK_ATTRIBUTE
|
||||||
|
|
||||||
|
s_initialized = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
32
Userland/Libraries/LibWeb/XLink/AttributeNames.h
Normal file
32
Userland/Libraries/LibWeb/XLink/AttributeNames.h
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2023, Shannon Booth <shannon@serenityos.org>
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <AK/Error.h>
|
||||||
|
#include <AK/FlyString.h>
|
||||||
|
|
||||||
|
namespace Web::XLink::AttributeNames {
|
||||||
|
|
||||||
|
#define ENUMERATE_XLINK_ATTRIBUTES(E) \
|
||||||
|
E(type) \
|
||||||
|
E(href) \
|
||||||
|
E(role) \
|
||||||
|
E(arcrole) \
|
||||||
|
E(title) \
|
||||||
|
E(show) \
|
||||||
|
E(actuate) \
|
||||||
|
E(label) \
|
||||||
|
E(from) \
|
||||||
|
E(to)
|
||||||
|
|
||||||
|
#define __ENUMERATE_XLINK_ATTRIBUTE(name) extern FlyString name;
|
||||||
|
ENUMERATE_XLINK_ATTRIBUTES(__ENUMERATE_XLINK_ATTRIBUTE)
|
||||||
|
#undef __ENUMERATE_XLINK_ATTRIBUTE
|
||||||
|
|
||||||
|
void initialize_strings();
|
||||||
|
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue