chromium/third_party/blink/renderer/platform/geometry/calculation_expression_node.h

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_GEOMETRY_CALCULATION_EXPRESSION_NODE_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_GEOMETRY_CALCULATION_EXPRESSION_NODE_H_

#include "base/check_op.h"
#include "third_party/blink/renderer/platform/geometry/length.h"
#include "third_party/blink/renderer/platform/wtf/casting.h"
#include "third_party/blink/renderer/platform/wtf/ref_counted.h"
#include "third_party/blink/renderer/platform/wtf/text/atomic_string.h"
#include "third_party/blink/renderer/platform/wtf/vector.h"

namespace blink {

enum class CalculationOperator {};

// Represents an expression composed of numbers, |PixelsAndPercent| and multiple
// types of operators. To be consumed by |Length| values that involve
// non-trivial math functions like min() and max().
class PLATFORM_EXPORT CalculationExpressionNode
    : public RefCounted<CalculationExpressionNode> {};

class PLATFORM_EXPORT CalculationExpressionNumberNode final
    : public CalculationExpressionNode {};

template <>
struct DowncastTraits<CalculationExpressionNumberNode> {};

class PLATFORM_EXPORT CalculationExpressionIdentifierNode final
    : public CalculationExpressionNode {};

template <>
struct DowncastTraits<CalculationExpressionIdentifierNode> {};

class PLATFORM_EXPORT CalculationExpressionSizingKeywordNode final
    : public CalculationExpressionNode {};

template <>
struct DowncastTraits<CalculationExpressionSizingKeywordNode> {};

class PLATFORM_EXPORT CalculationExpressionPixelsAndPercentNode final
    : public CalculationExpressionNode {};

template <>
struct DowncastTraits<CalculationExpressionPixelsAndPercentNode> {};

class PLATFORM_EXPORT CalculationExpressionOperationNode final
    : public CalculationExpressionNode {};

template <>
struct DowncastTraits<CalculationExpressionOperationNode> {};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_PLATFORM_GEOMETRY_CALCULATION_EXPRESSION_NODE_H_