chromium/third_party/blink/renderer/core/layout/svg/svg_text_layout_attributes_builder.cc

// 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.

#include "third_party/blink/renderer/core/layout/svg/svg_text_layout_attributes_builder.h"

#include <optional>

#include "base/containers/adapters.h"
#include "base/ranges/algorithm.h"
#include "third_party/blink/renderer/core/layout/inline/inline_item.h"
#include "third_party/blink/renderer/core/layout/inline/inline_node.h"
#include "third_party/blink/renderer/core/svg/svg_animated_length.h"
#include "third_party/blink/renderer/core/svg/svg_animated_length_list.h"
#include "third_party/blink/renderer/core/svg/svg_animated_number_list.h"
#include "third_party/blink/renderer/core/svg/svg_length_context.h"
#include "third_party/blink/renderer/core/svg/svg_text_positioning_element.h"

namespace blink {

struct SVGTextLengthContext {};

}  // namespace blink

WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS()

namespace blink {

namespace {

// Iterates over x/y/dx/dy/rotate attributes on an SVGTextPositioningElement.
//
// This class is used only by LayoutAttributesStack.
// This class is not copyable.
class LayoutAttributesIterator final
    : public GarbageCollected<LayoutAttributesIterator> {};

// A stack of LayoutAttributesIterator.
// This class is not copyable.
class LayoutAttributesStack final {};

bool HasUpdated(const SvgCharacterData& data) {}

bool HasValidTextLength(const LayoutObject& layout_object) {}

}  // anonymous namespace

SvgTextLayoutAttributesBuilder::SvgTextLayoutAttributesBuilder(InlineNode ifc)
    :{}

// This is an implementation of "3. Resolve character positioning" in [1],
// without recursion.
//
// An SVGCharacterDataWithAnchor stores resolve_x, resolve_y, resolve_dx,
// resolve_dy, "rotate" of result[], and "anchored chunk" of result[].
//
// [1]: https://svgwg.org/svg2-draft/text.html#TextLayoutAlgorithm
void SvgTextLayoutAttributesBuilder::Build(
    const String& ifc_text_content,
    const HeapVector<InlineItem>& items) {}

SvgInlineNodeData* SvgTextLayoutAttributesBuilder::CreateSvgInlineNodeData() {}

unsigned SvgTextLayoutAttributesBuilder::IfcTextContentOffsetAt(
    wtf_size_t index) {}

}  // namespace blink