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

// Copyright 2022 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/initial_letter_utils.h"

#include "third_party/blink/renderer/core/layout/exclusions/exclusion_area.h"
#include "third_party/blink/renderer/core/layout/geometry/writing_mode_converter.h"
#include "third_party/blink/renderer/core/layout/inline/inline_cursor.h"
#include "third_party/blink/renderer/core/layout/inline/line_info.h"
#include "third_party/blink/renderer/core/layout/inline/line_utils.h"
#include "third_party/blink/renderer/core/layout/inline/logical_line_item.h"
#include "third_party/blink/renderer/core/layout/logical_fragment.h"
#include "third_party/blink/renderer/core/layout/physical_box_fragment.h"
#include "third_party/blink/renderer/platform/text/writing_direction_mode.h"

namespace blink {

namespace {

// Returns border-box block offset of initial letter box to contain initial
// letter text and shift down amount of surrounding text in
// `initial_letter_block_start_adjust`,
LayoutUnit ComputeInitialLetterBoxBlockOffset(
    const PhysicalBoxFragment& initial_letter_box_fragment,
    const LayoutUnit block_size,
    const ComputedStyle& initial_letter_box_style,
    const ComputedStyle& paragraph_style,
    LayoutUnit* initial_letter_block_start_adjust) {}

// Returns left-top origin of text ink bounds.
LogicalRect ComputeTextInkBounds(const ShapeResultView& shape_result,
                                 const ComputedStyle& style,
                                 LayoutUnit* out_baseline = nullptr) {}

// `origin` holds left-top for LTR, right-top for RTL.
const ExclusionArea* CreateExclusionSpaceForInitialLetterBox(
    EFloat float_type,
    BfcOffset origin,
    const BfcOffset& border_box_offset,
    const LogicalSize& border_box_size,
    const BoxStrut& margins,
    bool is_hidden_for_paint) {}

}  // namespace

FontHeight AdjustInitialLetterInTextPosition(const FontHeight& line_box_metrics,
                                             LogicalLineItems* line_box) {}

LayoutUnit CalculateInitialLetterBoxInlineSize(const LineInfo& line_info) {}

const ExclusionArea* PostPlaceInitialLetterBox(
    const FontHeight& line_box_metrics,
    const BoxStrut& initial_letter_box_margins,
    LogicalLineItems* line_box,
    const BfcOffset& line_origin,
    LineInfo* line_info) {}

}  // namespace blink