dymokomi/luce-browser-engine
Source of release 0.6.1
0.6.1 / src / web / x_link / attribute_names.lucb
#==============================================================================================
#
# attribute_names - XLink::AttributeNames: the names of the XLink attributes
#
# DESCRIPTION:
# Port of Libraries/LibWeb/XLink/AttributeNames.cpp (lines 1-16) with AttributeNames.h's
# ENUMERATE_XLINK_ATTRIBUTES. C++ initializes the FlyStrings statically; here
# x_link_attribute_names_initialize_strings interns them at run time and
# web_initialize_strings runs it at startup (DESIGN.md ยง2.6).
#
# Copyright (c) 2023, Shannon Booth <shannon@serenityos.org>
# SPDX-License-Identifier: BSD-2-Clause
#
#==============================================================================================
## Whether x_link_attribute_names_initialize_strings has run.
var x_link_attribute_names_strings_initialized: bool
## Ported from Libraries/LibWeb/XLink/AttributeNames.cpp:12 the definitions of Web::XLink::AttributeNames's FlyStrings
## (`FlyString name = #name##_fly_string;` for each ENUMERATE_XLINK_ATTRIBUTES entry).
pub func x_link_attribute_names_initialize_strings():
if x_link_attribute_names_strings_initialized:
return
x_link_attribute_names_actuate = ak.fly_string_from_str("actuate")
x_link_attribute_names_arcrole = ak.fly_string_from_str("arcrole")
x_link_attribute_names_from = ak.fly_string_from_str("from")
x_link_attribute_names_href = ak.fly_string_from_str("href")
x_link_attribute_names_label = ak.fly_string_from_str("label")
x_link_attribute_names_role = ak.fly_string_from_str("role")
x_link_attribute_names_show = ak.fly_string_from_str("show")
x_link_attribute_names_title = ak.fly_string_from_str("title")
x_link_attribute_names_to = ak.fly_string_from_str("to")
x_link_attribute_names_type = ak.fly_string_from_str("type")
x_link_attribute_names_strings_initialized = true