#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_MATHML_MATH_LAYOUT_UTILS_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_MATHML_MATH_LAYOUT_UTILS_H_
#include <optional>
#include "third_party/blink/renderer/core/layout/constraint_space.h"
#include "third_party/blink/renderer/core/style/computed_style.h"
#include "third_party/blink/renderer/platform/fonts/opentype/open_type_math_support.h"
namespace blink {
class BlockNode;
class ConstraintSpace;
class LayoutInputNode;
class SimpleFontData;
struct LogicalSize;
struct MinMaxSizes;
struct MinMaxSizesResult;
ConstraintSpace CreateConstraintSpaceForMathChild(
const BlockNode& parent_node,
const LogicalSize& child_available_size,
const ConstraintSpace& parent_constraint_space,
const LayoutInputNode&,
const LayoutResultCacheSlot = LayoutResultCacheSlot::kLayout,
const std::optional<ConstraintSpace::MathTargetStretchBlockSizes>
target_stretch_block_sizes = std::nullopt,
const std::optional<LayoutUnit> target_stretch_inline_size = std::nullopt);
MinMaxSizesResult ComputeMinAndMaxContentContributionForMathChild(
const ComputedStyle& parent_style,
const ConstraintSpace& parent_constraint_space,
const BlockNode& child,
LayoutUnit child_available_block_size);
LayoutInputNode FirstChildInFlow(const BlockNode&);
LayoutInputNode NextSiblingInFlow(const BlockNode&);
bool IsValidMathMLFraction(const BlockNode&);
bool IsValidMathMLScript(const BlockNode&);
bool IsValidMathMLRadical(const BlockNode&);
inline float RuleThicknessFallback(const ComputedStyle& style) { … }
LayoutUnit MathAxisHeight(const ComputedStyle& style);
inline std::optional<float> MathConstant(
const ComputedStyle& style,
OpenTypeMathSupport::MathConstants constant) { … }
LayoutUnit FractionLineThickness(const ComputedStyle&);
inline bool HasDisplayStyle(const ComputedStyle& style) { … }
struct RadicalHorizontalParameters { … };
RadicalHorizontalParameters GetRadicalHorizontalParameters(
const ComputedStyle&);
struct RadicalVerticalParameters { … };
RadicalVerticalParameters GetRadicalVerticalParameters(const ComputedStyle&,
bool has_index);
MinMaxSizes GetMinMaxSizesForVerticalStretchyOperator(const ComputedStyle&,
UChar character);
bool IsUnderOverLaidOutAsSubSup(const BlockNode& node);
bool IsTextOnlyToken(const BlockNode& node);
bool IsOperatorWithSpecialShaping(const BlockNode& node);
LayoutUnit MathTableBaseline(const ComputedStyle&, LayoutUnit block_offset);
struct MathMLEmbellishedOperatorProperties { … };
std::optional<MathMLEmbellishedOperatorProperties>
GetMathMLEmbellishedOperatorProperties(const BlockNode&);
bool IsStretchyOperator(const BlockNode& node, bool stretch_axis_is_vertical);
inline bool IsBlockAxisStretchyOperator(const BlockNode& node) { … }
inline bool IsInlineAxisStretchyOperator(const BlockNode& node) { … }
}
#endif