chromium/third_party/blink/renderer/core/layout/svg/resolved_text_layout_attributes_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_LAYOUT_SVG_RESOLVED_TEXT_LAYOUT_ATTRIBUTES_ITERATOR_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_SVG_RESOLVED_TEXT_LAYOUT_ATTRIBUTES_ITERATOR_H_

#include <algorithm>
#include <iterator>
#include <utility>

#include "third_party/blink/renderer/core/layout/svg/svg_character_data.h"
#include "third_party/blink/renderer/platform/wtf/vector.h"

namespace blink {

// This class wraps a sparse list, |Vector<std::pair<unsigned,
// SvgCharacterData>>|, so that it looks to have SvgCharacterData for any index.
//
// For example, if |resolved| contains the following pairs:
//     resolved[0]: (0, SvgCharacterData)
//     resolved[1]: (10, SvgCharacterData)
//     resolved[2]: (42, SvgCharacterData)
//
// AdvanceTo(0) returns the SvgCharacterData at [0].
// AdvanceTo(1 - 9) returns the default SvgCharacterData, which has no data.
// AdvanceTo(10) returns the SvgCharacterData at [1].
// AdvanceTo(11 - 41) returns the default SvgCharacterData.
// AdvanceTo(42) returns the SvgCharacterData at [2].
// AdvanceTo(43 or greater) returns the default SvgCharacterData.
class ResolvedTextLayoutAttributesIterator final {};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_SVG_RESOLVED_TEXT_LAYOUT_ATTRIBUTES_ITERATOR_H_