chromium/third_party/blink/renderer/core/layout/geometry/box_strut.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_BOX_STRUT_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_GEOMETRY_BOX_STRUT_H_

#include <utility>

#include "base/notreached.h"
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/layout/geometry/box_sides.h"
#include "third_party/blink/renderer/core/layout/geometry/logical_offset.h"
#include "third_party/blink/renderer/core/layout/geometry/physical_offset.h"
#include "third_party/blink/renderer/platform/geometry/layout_unit.h"
#include "third_party/blink/renderer/platform/text/text_direction.h"
#include "third_party/blink/renderer/platform/text/writing_mode.h"
#include "ui/gfx/geometry/outsets_f.h"

namespace WTF {
class String;
}  // namespace WTF

namespace blink {

struct LineBoxStrut;
struct LogicalRect;
struct LogicalSize;
struct PhysicalBoxStrut;
struct PhysicalRect;
struct PhysicalSize;

// This struct is used for storing margins, borders or padding of a box on all
// four edges.
struct CORE_EXPORT BoxStrut {};

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

// A variant of BoxStrut in the line-relative coordinate system.
//
// 'line-over' is 'block-start' and 'line-under' is 'block-end' unless it is in
// flipped-lines writing-mode (i.e., 'vertical-lr'), in which case they are
// swapped.
//
// https://drafts.csswg.org/css-writing-modes-3/#line-mappings
struct CORE_EXPORT LineBoxStrut {};

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

// Struct to store physical dimensions, independent of writing mode and
// direction.
// See https://drafts.csswg.org/css-writing-modes-3/#abstract-box
struct CORE_EXPORT PhysicalBoxStrut {};

inline PhysicalBoxStrut BoxStrut::ConvertToPhysical(
    WritingDirectionMode writing_direction) const {}

inline PhysicalBoxStrut operator-(const PhysicalBoxStrut& a) {}

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_GEOMETRY_BOX_STRUT_H_