mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibWeb: Return true for is_operator_node()
for math-function nodes
This commit is contained in:
parent
3372a691da
commit
434bac3c67
Notes:
sideshowbarker
2024-07-17 02:06:40 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/434bac3c67 Pull-request: https://github.com/SerenityOS/serenity/pull/19819
1 changed files with 33 additions and 2 deletions
|
@ -193,12 +193,43 @@ public:
|
|||
|
||||
Type type() const { return m_type; }
|
||||
|
||||
// https://www.w3.org/TR/css-values-4/#calculation-tree-operator-nodes
|
||||
bool is_operator_node() const
|
||||
{
|
||||
// FIXME: Check for operator node types once they exist
|
||||
return is_calc_operator_node();
|
||||
return is_calc_operator_node() || is_math_function_node();
|
||||
}
|
||||
|
||||
bool is_math_function_node() const
|
||||
{
|
||||
switch (m_type) {
|
||||
case Type::Min:
|
||||
case Type::Max:
|
||||
case Type::Clamp:
|
||||
case Type::Abs:
|
||||
case Type::Sign:
|
||||
case Type::Sin:
|
||||
case Type::Cos:
|
||||
case Type::Tan:
|
||||
case Type::Asin:
|
||||
case Type::Acos:
|
||||
case Type::Atan:
|
||||
case Type::Atan2:
|
||||
case Type::Pow:
|
||||
case Type::Sqrt:
|
||||
case Type::Hypot:
|
||||
case Type::Log:
|
||||
case Type::Exp:
|
||||
case Type::Round:
|
||||
case Type::Mod:
|
||||
case Type::Rem:
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/css-values-4/#calculation-tree-calc-operator-nodes
|
||||
bool is_calc_operator_node() const
|
||||
{
|
||||
return first_is_one_of(m_type, Type::Sum, Type::Product, Type::Negate, Type::Invert);
|
||||
|
|
Loading…
Reference in a new issue