chromium/third_party/blink/renderer/core/paint/fragment_data_iterator.h

// Copyright 2021 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_PAINT_FRAGMENT_DATA_ITERATOR_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_PAINT_FRAGMENT_DATA_ITERATOR_H_

#include <cstddef>
#include <optional>

#include "third_party/blink/renderer/core/layout/inline/inline_cursor.h"
#include "third_party/blink/renderer/core/paint/fragment_data.h"

namespace blink {

class LayoutBox;
class LayoutObject;
class PhysicalBoxFragment;

template <typename Iterator, typename Data, typename Head>
class FragmentDataIteratorBase {};

class FragmentDataIterator
    : public FragmentDataIteratorBase<FragmentDataIterator,
                                      const FragmentData,
                                      const FragmentDataList> {};

class MutableFragmentDataIterator
    : public FragmentDataIteratorBase<MutableFragmentDataIterator,
                                      FragmentData,
                                      FragmentDataList> {};

// FragmentData iterator, accompanied by "corresponding" NG layout structures.
// For LayoutBox, this means PhysicalBoxFragment. For non-atomic inlines, it
// means InlineCursor. For non-atomic inlines, this also means that Advance()
// will stop for each line on which the LayoutObject is represented. There may
// be multiple lines per FragmentData (whereas there's just one FragmentData per
// fragmentainer), meaning that Advance() may stop several times at the same
// FragmentData while progressing through the lines.
class AccompaniedFragmentIterator : public FragmentDataIterator {};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_PAINT_FRAGMENT_DATA_ITERATOR_H_