chromium/third_party/blink/renderer/core/layout/anchor_evaluator_impl.h

// Copyright 2022 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_ANCHOR_EVALUATOR_IMPL_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_ANCHOR_EVALUATOR_IMPL_H_

#include <optional>

#include "third_party/abseil-cpp/absl/types/variant.h"
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/css/anchor_evaluator.h"
#include "third_party/blink/renderer/core/css/css_anchor_query_enums.h"
#include "third_party/blink/renderer/core/layout/geometry/physical_offset.h"
#include "third_party/blink/renderer/core/layout/geometry/physical_rect.h"
#include "third_party/blink/renderer/core/layout/geometry/writing_mode_converter.h"
#include "third_party/blink/renderer/core/style/scoped_css_name.h"
#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h"
#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_set.h"
#include "third_party/blink/renderer/platform/wtf/text/atomic_string.h"
#include "third_party/blink/renderer/platform/wtf/text/atomic_string_hash.h"

namespace blink {

class AnchorSpecifierValue;
class Element;
class LayoutObject;
class LogicalAnchorQuery;
class LogicalAnchorQueryMap;
class PaintLayer;
struct LogicalAnchorReference;

AnchorKey;

// This class is conceptually a concatenation of two hash maps with different
// key types but the same value type. To save memory, we don't implement it as
// one hash map with a unified key type; Otherwise, the size of each key will be
// increased by at least one pointer, which is undesired.
template <typename AnchorReference>
class AnchorQueryBase : public GarbageCollectedMixin {};

struct CORE_EXPORT PhysicalAnchorReference
    : public GarbageCollected<PhysicalAnchorReference> {};

class CORE_EXPORT PhysicalAnchorQuery
    : public AnchorQueryBase<PhysicalAnchorReference> {};

struct CORE_EXPORT LogicalAnchorReference
    : public GarbageCollected<LogicalAnchorReference> {};

class CORE_EXPORT LogicalAnchorQuery
    : public GarbageCollected<LogicalAnchorQuery>,
      public AnchorQueryBase<LogicalAnchorReference> {};

class CORE_EXPORT AnchorEvaluatorImpl : public AnchorEvaluator {};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_ANCHOR_EVALUATOR_IMPL_H_