chromium/third_party/blink/renderer/core/layout/inline/inline_child_layout_context.h

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_INLINE_INLINE_CHILD_LAYOUT_CONTEXT_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_INLINE_INLINE_CHILD_LAYOUT_CONTEXT_H_

#include <optional>

#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/layout/inline/fragment_items_builder.h"
#include "third_party/blink/renderer/core/layout/inline/inline_box_state.h"
#include "third_party/blink/renderer/core/layout/inline/logical_line_item.h"
#include "third_party/blink/renderer/core/layout/inline/score_line_break_context.h"

namespace blink {

class InlineItem;

// A context object given to layout. The same instance should be given to
// children of a parent node, but layout algorithm should be prepared to be
// given a new instance when yield or fragmentation occur.
//
// Because this context is in initial state for when fragmentation occurs and
// some other cases, do not add things that are too expensive to rebuild.
//
// This class has no public constructors. Instantiate one of subclasses below
// depending on the line breaker type for the context.
class CORE_EXPORT InlineChildLayoutContext {};

// A subclass of `InlineChildLayoutContext` for when the algorithm requires
// only one `LineInfo`.
class CORE_EXPORT SimpleInlineChildLayoutContext
    : public InlineChildLayoutContext {};

// A subclass of `InlineChildLayoutContext` for when the algorithm requires
// `ScoreLineBreakContext`.
template <wtf_size_t max_lines>
class CORE_EXPORT OptimalInlineChildLayoutContext
    : public InlineChildLayoutContext {};

inline LineInfo& InlineChildLayoutContext::GetLineInfo(
    const InlineBreakToken* break_token,
    bool& is_cached_out) {}

inline LogicalLineItems&
InlineChildLayoutContext::AcquireTempLogicalLineItems() {}

inline void InlineChildLayoutContext::ReleaseTempLogicalLineItems(
    LogicalLineItems& line_items) {}

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_INLINE_INLINE_CHILD_LAYOUT_CONTEXT_H_