chromium/third_party/blink/renderer/core/layout/mathml/math_layout_utils.cc

// 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.

#include "third_party/blink/renderer/core/layout/mathml/math_layout_utils.h"

#include "third_party/blink/renderer/core/layout/block_node.h"
#include "third_party/blink/renderer/core/layout/constraint_space_builder.h"
#include "third_party/blink/renderer/core/layout/layout_box.h"
#include "third_party/blink/renderer/core/layout/length_utils.h"
#include "third_party/blink/renderer/core/layout/space_utils.h"
#include "third_party/blink/renderer/core/mathml/mathml_fraction_element.h"
#include "third_party/blink/renderer/core/mathml/mathml_operator_element.h"
#include "third_party/blink/renderer/core/mathml/mathml_radical_element.h"
#include "third_party/blink/renderer/core/mathml/mathml_scripts_element.h"
#include "third_party/blink/renderer/core/mathml/mathml_token_element.h"

namespace blink {

ConstraintSpace CreateConstraintSpaceForMathChild(
    const BlockNode& parent_node,
    const LogicalSize& child_available_size,
    const ConstraintSpace& parent_space,
    const LayoutInputNode& child,
    LayoutResultCacheSlot cache_slot,
    const std::optional<ConstraintSpace::MathTargetStretchBlockSizes>
        target_stretch_block_sizes,
    const std::optional<LayoutUnit> target_stretch_inline_size) {}

MinMaxSizesResult ComputeMinAndMaxContentContributionForMathChild(
    const ComputedStyle& parent_style,
    const ConstraintSpace& parent_space,
    const BlockNode& child,
    LayoutUnit child_available_block_size) {}

LayoutInputNode FirstChildInFlow(const BlockNode& node) {}

LayoutInputNode NextSiblingInFlow(const BlockNode& node) {}

inline bool InFlowChildCountIs(const BlockNode& node, unsigned count) {}

bool IsValidMathMLFraction(const BlockNode& node) {}

static bool IsPrescriptDelimiter(const BlockNode& block_node) {}

// Valid according to:
// https://w3c.github.io/mathml-core/#prescripts-and-tensor-indices-mmultiscripts
inline bool IsValidMultiscript(const BlockNode& node) {}

bool IsValidMathMLScript(const BlockNode& node) {}

bool IsValidMathMLRadical(const BlockNode& node) {}

RadicalHorizontalParameters GetRadicalHorizontalParameters(
    const ComputedStyle& style) {}

RadicalVerticalParameters GetRadicalVerticalParameters(
    const ComputedStyle& style,
    bool has_index) {}

MinMaxSizes GetMinMaxSizesForVerticalStretchyOperator(
    const ComputedStyle& style,
    UChar character) {}

bool IsUnderOverLaidOutAsSubSup(const BlockNode& node) {}

bool IsTextOnlyToken(const BlockNode& node) {}

bool IsOperatorWithSpecialShaping(const BlockNode& node) {}

namespace {

inline LayoutUnit DefaultFractionLineThickness(const ComputedStyle& style) {}

}  // namespace

LayoutUnit MathAxisHeight(const ComputedStyle& style) {}

LayoutUnit FractionLineThickness(const ComputedStyle& style) {}

LayoutUnit MathTableBaseline(const ComputedStyle& style,
                             LayoutUnit block_offset) {}

namespace {

// This function has bad theoretical worst-case complexity. However, real-life
// MathML formulas don't use deeply nested space-like expressions so it should
// be fine in in practice. See https://github.com/w3c/mathml/issues/115
static bool IsSpaceLike(const BlockNode& node) {}

// This function has bad theoretical worst-case complexity. However, real-life
// MathML formulas don't use deeply nested expressions that are embellished
// operators or that are essentially made of space-like descendants, so it
// should be fine in in practice. See https://github.com/w3c/mathml/issues/115
MathMLOperatorElement* GetCoreOperator(const BlockNode& node) {}

}  // namespace

std::optional<MathMLEmbellishedOperatorProperties>
GetMathMLEmbellishedOperatorProperties(const BlockNode& node) {}

bool IsStretchyOperator(const BlockNode& node, bool stretch_axis_is_vertical) {}

}  // namespace blink