chromium/third_party/blink/renderer/core/layout/geometry/logical_size.h

// Copyright 2016 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_GEOMETRY_LOGICAL_SIZE_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_GEOMETRY_LOGICAL_SIZE_H_

#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/layout/geometry/box_strut.h"
#include "third_party/blink/renderer/core/layout/geometry/logical_offset.h"
#include "third_party/blink/renderer/platform/geometry/layout_unit.h"
#include "third_party/blink/renderer/platform/text/writing_mode.h"

namespace blink {

struct LogicalOffset;

// LogicalSize is the size of rect (typically a fragment) in the logical
// coordinate system.
// For more information about physical and logical coordinate systems, see:
// https://chromium.googlesource.com/chromium/src/+/main/third_party/blink/renderer/core/layout/README.md#coordinate-spaces
struct CORE_EXPORT LogicalSize {};

constexpr LogicalSize kIndefiniteLogicalSize(kIndefiniteSize, kIndefiniteSize);

inline LogicalSize operator-(const LogicalSize& a, const BoxStrut& b) {}

inline LogicalSize& operator-=(LogicalSize& a, const BoxStrut& b) {}

inline LogicalSize operator+(const LogicalSize& a, const BoxStrut& b) {}

inline LogicalOffset operator+(const LogicalOffset& offset,
                               const LogicalSize& size) {}

inline LogicalOffset& operator+=(LogicalOffset& offset,
                                 const LogicalSize& size) {}

CORE_EXPORT std::ostream& operator<<(std::ostream&, const LogicalSize&);

// LogicalDelta resolves the ambiguity of subtractions.
//
// "offset - offset" is ambiguous because both of below are true:
//   offset + offset = offset
//   offset + size = offset
//
// LogicalDelta resolves this ambiguity by allowing implicit conversions both
// to LogicalOffset and to LogicalSize.
struct CORE_EXPORT LogicalDelta : public LogicalSize {};

inline LogicalDelta operator-(const LogicalOffset& a, const LogicalOffset& b) {}

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_GEOMETRY_LOGICAL_SIZE_H_