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

// Copyright 2023 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_MIN_MAX_SIZES_CACHE_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_MIN_MAX_SIZES_CACHE_H_

#include <optional>

#include "third_party/blink/renderer/core/layout/min_max_sizes.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/wtf/vector.h"
#include "third_party/blink/renderer/platform/wtf/vector_traits.h"

namespace blink {

// Implements an N-way LRU cache for min/max sizes.
//
// Some layout algorithms (grid in particular) query the min/max sizes of an
// element multiple times with different initial block-size each time.
//
// These sizes can differ when there is something dependent on that size -
// an element with an aspect-ratio with "height:100%" for example.
//
// This cache is designed to handle these cases.
class MinMaxSizesCache final : public GarbageCollected<MinMaxSizesCache> {};

}  // namespace blink

WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS()

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_MIN_MAX_SIZES_CACHE_H_