chromium/third_party/blink/renderer/core/layout/ink_overflow.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.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "third_party/blink/renderer/core/layout/ink_overflow.h"

#include "build/chromeos_buildflags.h"
#include "third_party/blink/renderer/core/editing/markers/custom_highlight_marker.h"
#include "third_party/blink/renderer/core/editing/markers/document_marker.h"
#include "third_party/blink/renderer/core/editing/markers/document_marker_controller.h"
#include "third_party/blink/renderer/core/highlight/highlight_style_utils.h"
#include "third_party/blink/renderer/core/layout/geometry/logical_rect.h"
#include "third_party/blink/renderer/core/layout/geometry/writing_mode_converter.h"
#include "third_party/blink/renderer/core/layout/inline/fragment_item.h"
#include "third_party/blink/renderer/core/layout/text_decoration_offset.h"
#include "third_party/blink/renderer/core/paint/highlight_painter.h"
#include "third_party/blink/renderer/core/paint/inline_paint_context.h"
#include "third_party/blink/renderer/core/paint/marker_range_mapping_context.h"
#include "third_party/blink/renderer/core/paint/text_decoration_info.h"
#include "third_party/blink/renderer/core/style/applied_text_decoration.h"
#include "third_party/blink/renderer/core/style/computed_style.h"
#include "third_party/blink/renderer/platform/transforms/affine_transform.h"
#include "third_party/blink/renderer/platform/wtf/size_assertions.h"

namespace blink {

namespace  // namespace

#if DCHECK_IS_ON()
// Define this for the debugging purpose to DCHECK if uncomputed ink overflow is
// happening. As DCHECK builds ship, enabling this for all DCHECK builds causes
// more troubles than to help.
//
// #define DISALLOW_READING_UNSET

unsigned InkOverflow::read_unset_as_none_ =;

InkOverflow::~InkOverflow() {}
#endif

InkOverflow::InkOverflow(Type source_type, const InkOverflow& source) {}

InkOverflow::InkOverflow(Type source_type, InkOverflow&& source) {}

InkOverflow::Type InkOverflow::Reset(Type type, Type new_type) {}

PhysicalRect InkOverflow::FromOutsets(const PhysicalSize& size) const {}

PhysicalRect InkOverflow::Self(Type type, const PhysicalSize& size) const {}

PhysicalRect InkOverflow::Contents(Type type, const PhysicalSize& size) const {}

PhysicalRect InkOverflow::SelfAndContents(Type type,
                                          const PhysicalSize& size) const {}

// Store |ink_overflow| as |SmallRawValue| if possible and returns |true|.
// Returns |false| if |ink_overflow| is too large for |SmallRawValue|.
bool InkOverflow::TrySetOutsets(Type type,
                                LayoutUnit left_outset,
                                LayoutUnit top_outset,
                                LayoutUnit right_outset,
                                LayoutUnit bottom_outset) {}

InkOverflow::Type InkOverflow::SetSingle(Type type,
                                         const PhysicalRect& ink_overflow,
                                         const PhysicalSize& size,
                                         Type new_type,
                                         Type new_small_type) {}

InkOverflow::Type InkOverflow::SetSelf(Type type,
                                       const PhysicalRect& ink_overflow,
                                       const PhysicalSize& size) {}

InkOverflow::Type InkOverflow::SetContents(Type type,
                                           const PhysicalRect& ink_overflow,
                                           const PhysicalSize& size) {}

InkOverflow::Type InkOverflow::Set(Type type,
                                   const PhysicalRect& self,
                                   const PhysicalRect& contents,
                                   const PhysicalSize& size) {}

InkOverflow::Type InkOverflow::SetTextInkOverflow(
    Type type,
    const InlineCursor& cursor,
    const TextFragmentPaintInfo& text_info,
    const ComputedStyle& style,
    const PhysicalRect& rect_in_container,
    const InlinePaintContext* inline_context,
    PhysicalRect* ink_overflow_out) {}

InkOverflow::Type InkOverflow::SetSvgTextInkOverflow(
    Type type,
    const InlineCursor& cursor,
    const TextFragmentPaintInfo& text_info,
    const ComputedStyle& style,
    const Font& scaled_font,
    const gfx::RectF& rect,
    float scaling_factor,
    float length_adjust_scale,
    const AffineTransform& transform,
    PhysicalRect* ink_overflow_out) {}

// static
std::optional<PhysicalRect> InkOverflow::ComputeTextInkOverflow(
    const InlineCursor& cursor,
    const TextFragmentPaintInfo& text_info,
    const ComputedStyle& style,
    const Font& scaled_font,
    const PhysicalRect& rect_in_container,
    const InlinePaintContext* inline_context) {}

// static
LogicalRect InkOverflow::ComputeEmphasisMarkOverflow(
    const ComputedStyle& style,
    const PhysicalSize& size,
    const LogicalRect& ink_overflow_in) {}

// static
void InkOverflow::ExpandForShadowOverflow(LogicalRect& ink_overflow,
                                          const ShadowList& text_shadow,
                                          const WritingMode writing_mode) {}

// static
LogicalRect InkOverflow::ComputeDecorationOverflow(
    const InlineCursor& cursor,
    const ComputedStyle& style,
    const Font& scaled_font,
    const PhysicalOffset& container_offset,
    const LogicalRect& ink_overflow,
    const InlinePaintContext* inline_context,
    const WritingMode writing_mode) {}

LogicalRect InkOverflow::ComputeAppliedDecorationOverflow(
    const ComputedStyle& style,
    const Font& scaled_font,
    const PhysicalOffset& offset_in_container,
    const LogicalRect& ink_overflow,
    const InlinePaintContext* inline_context,
    const AppliedTextDecoration* decoration_override) {}

LogicalRect InkOverflow::ComputeMarkerOverflow(
    const DocumentMarkerVector& markers,
    const DocumentMarker::MarkerType type,
    const FragmentItem* fragment_item,
    const TextOffsetRange& fragment_dom_offsets,
    Text* text_node,
    const ComputedStyle& style,
    const Font& scaled_font,
    const PhysicalOffset& offset_in_container,
    const LogicalRect& ink_overflow,
    const InlinePaintContext* inline_context,
    const WritingMode writing_mode) {}

LogicalRect InkOverflow::ComputeCustomHighlightOverflow(
    const DocumentMarkerVector& markers,
    const FragmentItem* fragment_item,
    const TextOffsetRange& fragment_dom_offsets,
    Text* text_node,
    const ComputedStyle& style,
    const Font& scaled_font,
    const PhysicalOffset& offset_in_container,
    const LogicalRect& ink_overflow,
    const InlinePaintContext* inline_context) {}

}  // namespace blink