summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/core/style/quad_length_value.h
blob: 53211ccf70e9d9e770c296626244eb67b91680b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright 2017 The Chromium Authors. All rights reserved.
// 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_STYLE_QUAD_LENGTH_VALUE_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_STYLE_QUAD_LENGTH_VALUE_H_

#include <memory>
#include "third_party/blink/renderer/platform/geometry/length.h"

namespace blink {

struct QuadLengthValue {
  DISALLOW_NEW();

  QuadLengthValue() {}

  explicit QuadLengthValue(Length length)
      : top(length), right(length), bottom(length), left(length) {}

  QuadLengthValue(const QuadLengthValue& other)
      : top(other.top),
        right(other.right),
        bottom(other.bottom),
        left(other.left) {}

  bool operator==(const QuadLengthValue& other) const {
    return top == other.top && right == other.right && bottom == other.bottom &&
           left == other.left;
  }

  bool operator!=(const QuadLengthValue& other) const {
    return !(*this == other);
  }

  Length top;
  Length right;
  Length bottom;
  Length left;
};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_STYLE_QUAD_LENGTH_VALUE_H_