Luce packages
LuceLuce BaseLuciaOS

dymokomi/luce-browser-css

Source of release 0.5.1

0.5.1 / src / css_data / generated_math_functions.lucb

#==============================================================================================
#
#   generated_math_functions - the CSS math functions
#
#   DESCRIPTION:
#       Generated by tools/gen_css from data/css; do not edit. The C++ it stands for, at
#       Ladybird 47c82b38d0, is written by Meta/Generators/generate_libweb_css_math_functions.py
#       from MathFunctions.json:
#
#           Build/Libraries/LibWeb/CSS/MathFunctions.h
#           Build/Libraries/LibWeb/CSS/MathFunctions.cpp
#
#       Parser::parse_math_function() and parse_rounding_strategy() are the engine's.
#
#       Copyright (c) 2018-2026, the Ladybird developers.
#       Copyright (c) 2026 the luce-browser authors.
#       SPDX-License-Identifier: BSD-2-Clause (see LICENSE)
#
#==============================================================================================

## Web::CSS::MathFunction (Build/Libraries/LibWeb/CSS/MathFunctions.h).
pub enum MathFunction as i32:
    calc = 0
    abs = 1
    acos = 2
    asin = 3
    atan = 4
    atan2 = 5
    clamp = 6
    cos = 7
    exp = 8
    hypot = 9
    log = 10
    max = 11
    min = 12
    mod = 13
    pow = 14
    random = 15
    rem = 16
    round = 17
    sign = 18
    sin = 19
    sqrt = 20
    tan = 21

## Ported from Build/Libraries/LibWeb/CSS/MathFunctions.cpp Web::CSS::math_function_from_string.
pub func math_function_from_string(name: ak.StringView) -> MathFunction?:
    if ak.string_view_equals_ignoring_ascii_case(&name, ak.sv("calc")):
        return MathFunction.calc
    if ak.string_view_equals_ignoring_ascii_case(&name, ak.sv("abs")):
        return MathFunction.abs
    if ak.string_view_equals_ignoring_ascii_case(&name, ak.sv("acos")):
        return MathFunction.acos
    if ak.string_view_equals_ignoring_ascii_case(&name, ak.sv("asin")):
        return MathFunction.asin
    if ak.string_view_equals_ignoring_ascii_case(&name, ak.sv("atan")):
        return MathFunction.atan
    if ak.string_view_equals_ignoring_ascii_case(&name, ak.sv("atan2")):
        return MathFunction.atan2
    if ak.string_view_equals_ignoring_ascii_case(&name, ak.sv("clamp")):
        return MathFunction.clamp
    if ak.string_view_equals_ignoring_ascii_case(&name, ak.sv("cos")):
        return MathFunction.cos
    if ak.string_view_equals_ignoring_ascii_case(&name, ak.sv("exp")):
        return MathFunction.exp
    if ak.string_view_equals_ignoring_ascii_case(&name, ak.sv("hypot")):
        return MathFunction.hypot
    if ak.string_view_equals_ignoring_ascii_case(&name, ak.sv("log")):
        return MathFunction.log
    if ak.string_view_equals_ignoring_ascii_case(&name, ak.sv("max")):
        return MathFunction.max
    if ak.string_view_equals_ignoring_ascii_case(&name, ak.sv("min")):
        return MathFunction.min
    if ak.string_view_equals_ignoring_ascii_case(&name, ak.sv("mod")):
        return MathFunction.mod
    if ak.string_view_equals_ignoring_ascii_case(&name, ak.sv("pow")):
        return MathFunction.pow
    if ak.string_view_equals_ignoring_ascii_case(&name, ak.sv("random")):
        return MathFunction.random
    if ak.string_view_equals_ignoring_ascii_case(&name, ak.sv("rem")):
        return MathFunction.rem
    if ak.string_view_equals_ignoring_ascii_case(&name, ak.sv("round")):
        return MathFunction.round
    if ak.string_view_equals_ignoring_ascii_case(&name, ak.sv("sign")):
        return MathFunction.sign
    if ak.string_view_equals_ignoring_ascii_case(&name, ak.sv("sin")):
        return MathFunction.sin
    if ak.string_view_equals_ignoring_ascii_case(&name, ak.sv("sqrt")):
        return MathFunction.sqrt
    if ak.string_view_equals_ignoring_ascii_case(&name, ak.sv("tan")):
        return MathFunction.tan
    return none