chromium/third_party/blink/renderer/core/layout/inline/ruby_utils.cc

// Copyright 2020 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/inline/ruby_utils.h"

#include <tuple>

#include "third_party/blink/renderer/core/layout/inline/inline_box_state.h"
#include "third_party/blink/renderer/core/layout/inline/inline_cursor.h"
#include "third_party/blink/renderer/core/layout/inline/inline_item_result.h"
#include "third_party/blink/renderer/core/layout/inline/inline_item_result_ruby_column.h"
#include "third_party/blink/renderer/core/layout/inline/justification_utils.h"
#include "third_party/blink/renderer/core/layout/inline/line_info.h"
#include "third_party/blink/renderer/core/layout/inline/logical_line_container.h"
#include "third_party/blink/renderer/core/layout/inline/logical_line_item.h"
#include "third_party/blink/renderer/core/layout/layout_object_inlines.h"
#include "third_party/blink/renderer/core/layout/physical_box_fragment.h"
#include "third_party/blink/renderer/platform/fonts/font_height.h"
#include "third_party/blink/renderer/platform/heap/collection_support/clear_collection_scope.h"

namespace blink {

namespace {

std::tuple<LayoutUnit, LayoutUnit> AdjustTextOverUnderOffsetsForEmHeight(
    LayoutUnit over,
    LayoutUnit under,
    const ComputedStyle& style,
    const ShapeResultView& shape_view) {}

FontHeight ComputeEmHeight(const LogicalLineItem& line_item) {}

}  // anonymous namespace

RubyItemIndexes ParseRubyInInlineItems(const HeapVector<InlineItem>& items,
                                       wtf_size_t start_item_index) {}

PhysicalRect AdjustTextRectForEmHeight(const PhysicalRect& rect,
                                       const ComputedStyle& style,
                                       const ShapeResultView* shape_view,
                                       WritingMode writing_mode) {}

AnnotationOverhang GetOverhang(
    LayoutUnit ruby_size,
    const LineInfo& base_line,
    const HeapVector<LineInfo, 1> annotation_line_list) {}

AnnotationOverhang GetOverhang(const InlineItemResult& item) {}

bool CanApplyStartOverhang(const LineInfo& line_info,
                           wtf_size_t ruby_index,
                           const ComputedStyle& ruby_style,
                           LayoutUnit& start_overhang) {}

LayoutUnit CommitPendingEndOverhang(const InlineItem& text_item,
                                    LineInfo* line_info) {}

std::pair<LayoutUnit, LayoutUnit> ApplyRubyAlign(LayoutUnit available_line_size,
                                                 bool on_start_edge,
                                                 bool on_end_edge,
                                                 LineInfo& line_info) {}

AnnotationMetrics ComputeAnnotationOverflow(
    const LogicalLineItems& logical_line,
    const FontHeight& line_box_metrics,
    const ComputedStyle& line_style,
    std::optional<FontHeight> annotation_metrics) {}

namespace {

// Em height box. including contents, in the local coordinate.
PhysicalRect ComputeRubyEmHeightBox(const PhysicalFragment& fragment,
                                    const PhysicalBoxFragment& container) {}

void AdjustRubyEmHeightBoxForPropagation(const PhysicalFragment& fragment,
                                         const PhysicalBoxFragment& container,
                                         PhysicalRect* overflow) {}

// ComputeRubyEmHeightBox(), with transforms applied wrt container if needed.
// This does not include any offsets from the parent (including relpos).
PhysicalRect ComputeRubyEmHeightBoxForPropagation(
    const PhysicalFragment& fragment,
    const PhysicalBoxFragment& container) {}

// Chop the hanging part from scrollable overflow. Children overflow in inline
// direction should hang, which should not cause scroll.
// TODO(kojii): Should move to text fragment to make this more accurate.
void AdjustRubyEmHeightBoxForHanging(const PhysicalRect& rect,
                                     const WritingMode container_writing_mode,
                                     PhysicalRect* overflow) {}

void AddRubyEmHeightBoxForInlineChild(const PhysicalFragment& child,
                                      const PhysicalBoxFragment& container,
                                      const ComputedStyle& container_style,
                                      const FragmentItem& line,
                                      bool has_hanging,
                                      const InlineCursor& cursor,
                                      PhysicalRect* overflow) {}

// Include the inline-size of the line-box in the overflow.
// Do not update block offset and block size of |overflow|.
inline void AddInlineSizeToRubyEmHeightBox(
    const PhysicalRect& rect,
    const WritingMode container_writing_mode,
    PhysicalRect* overflow) {}

// Em height box. including contents, in the local coordinate.
// |ComputeRubyEmHeightBoxForLine| is not precomputed/cached because it cannot
// be computed when LineBox is generated because it needs container dimensions
// to resolve relative position of its children.
PhysicalRect ComputeRubyEmHeightBoxForLine(
    const PhysicalLineBoxFragment& line_fragment,
    const PhysicalBoxFragment& container,
    const ComputedStyle& container_style) {}

PhysicalRect ComputeRubyEmHeightBoxForLine(
    const PhysicalLineBoxFragment& line_fragment,
    const PhysicalBoxFragment& container,
    const ComputedStyle& container_style,
    const FragmentItem& line,
    const InlineCursor& cursor) {}

PhysicalRect ComputeRubyEmHeightBoxFromChildren(
    const PhysicalBoxFragment& fragment) {}

}  // namespace

PhysicalRect ComputeRubyEmHeightBox(const PhysicalBoxFragment& box_fragment) {}

// ================================================================

void UpdateRubyColumnInlinePositions(
    const LogicalLineItems& line_items,
    LayoutUnit inline_size,
    HeapVector<Member<LogicalRubyColumn>>& column_list) {}

// ================================================================

namespace {

FontHeight ComputeLogicalLineEmHeight(const LogicalLineItems& line_items) {}

FontHeight ComputeLogicalLineEmHeight(const LogicalLineItems& line_items,
                                      const Vector<wtf_size_t>& index_list) {}

}  // namespace

RubyBlockPositionCalculator::RubyBlockPositionCalculator() = default;

RubyBlockPositionCalculator& RubyBlockPositionCalculator::GroupLines(
    const HeapVector<Member<LogicalRubyColumn>>& column_list) {}

void RubyBlockPositionCalculator::HandleRubyLine(
    const RubyLine& current_ruby_line,
    const HeapVector<Member<LogicalRubyColumn>>& column_list) {}

RubyBlockPositionCalculator::RubyLine&
RubyBlockPositionCalculator::EnsureRubyLine(const RubyLevel& level) {}

RubyBlockPositionCalculator& RubyBlockPositionCalculator::PlaceLines(
    const LogicalLineItems& base_line_items,
    const FontHeight& line_box_metrics) {}

RubyBlockPositionCalculator& RubyBlockPositionCalculator::AddLinesTo(
    LogicalLineContainer& line_container) {}

FontHeight RubyBlockPositionCalculator::AnnotationMetrics() const {}

// ================================================================

RubyBlockPositionCalculator::RubyLine::RubyLine(const RubyLevel& level)
    :{}

void RubyBlockPositionCalculator::RubyLine::Trace(Visitor* visitor) const {}

bool RubyBlockPositionCalculator::RubyLine::operator<(
    const RubyLine& another) const {}

void RubyBlockPositionCalculator::RubyLine::Append(
    LogicalRubyColumn& logical_column) {}

void RubyBlockPositionCalculator::RubyLine::MaybeRecordBaseIndexes(
    const LogicalRubyColumn& logical_column) {}

FontHeight RubyBlockPositionCalculator::RubyLine::UpdateMetrics() {}

void RubyBlockPositionCalculator::RubyLine::MoveInBlockDirection(
    LayoutUnit offset) {}

void RubyBlockPositionCalculator::RubyLine::AddLinesTo(
    LogicalLineContainer& line_container) const {}

// ================================================================

void RubyBlockPositionCalculator::AnnotationDepth::Trace(
    Visitor* visitor) const {}

}  // namespace blink