Luce packages
LuceLuce BaseLuciaOS

dymokomi/luce-browser-engine

Source of release 0.6.0

0.6.0 / src / web / math_ml / attribute_names.lucb

#==============================================================================================
#
#   attribute_names - MathML::AttributeNames: the names of the MathML attributes
#
#   DESCRIPTION:
#       Port of Libraries/LibWeb/MathML/AttributeNames.cpp (lines 1-16) with AttributeNames.h's
#       ENUMERATE_MATHML_ATTRIBUTES. C++ initializes the FlyStrings statically; here
#       math_ml_attribute_names_initialize_strings interns them at run time and
#       web_initialize_strings runs it at startup (DESIGN.md ยง2.6).
#
#       Copyright (c) 2025, Lorenz Ackermann, <me@lorenzackermann.xyz>
#       SPDX-License-Identifier: BSD-2-Clause
#
#==============================================================================================

## Whether math_ml_attribute_names_initialize_strings has run.
var math_ml_attribute_names_strings_initialized: bool

## Ported from Libraries/LibWeb/MathML/AttributeNames.cpp:12 the definitions of Web::MathML::AttributeNames's FlyStrings
## (`FlyString name = attribute##_fly_string;` for each ENUMERATE_MATHML_ATTRIBUTES entry).
pub func math_ml_attribute_names_initialize_strings():
    if math_ml_attribute_names_strings_initialized:
        return
    math_ml_attribute_names_autofocus = ak.fly_string_from_str("autofocus")
    math_ml_attribute_names_depth = ak.fly_string_from_str("depth")
    math_ml_attribute_names_dir = ak.fly_string_from_str("dir")
    math_ml_attribute_names_displaystyle = ak.fly_string_from_str("displaystyle")
    math_ml_attribute_names_height = ak.fly_string_from_str("height")
    math_ml_attribute_names_mathbackground = ak.fly_string_from_str("mathbackground")
    math_ml_attribute_names_mathcolor = ak.fly_string_from_str("mathcolor")
    math_ml_attribute_names_mathsize = ak.fly_string_from_str("mathsize")
    math_ml_attribute_names_mathvariant = ak.fly_string_from_str("mathvariant")
    math_ml_attribute_names_scriptlevel = ak.fly_string_from_str("scriptlevel")
    math_ml_attribute_names_width = ak.fly_string_from_str("width")
    math_ml_attribute_names_strings_initialized = true