summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/core/css/properties/style_building_utils.h
blob: 1fba8a59397775035c0f7c6c57be79a32b38de49 (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
// 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_CSS_PROPERTIES_STYLE_BUILDING_UTILS_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_CSS_PROPERTIES_STYLE_BUILDING_UTILS_H_

#include "third_party/blink/renderer/core/style/border_image_length.h"
#include "third_party/blink/renderer/core/style/border_image_length_box.h"
#include "third_party/blink/renderer/platform/length.h"
#include "third_party/blink/renderer/platform/length_box.h"

namespace blink {
namespace StyleBuildingUtils {

inline bool BorderImageLengthMatchesAllSides(
    const BorderImageLengthBox& border_image_length_box,
    const BorderImageLength& border_image_length) {
  return (border_image_length_box.Left() == border_image_length &&
          border_image_length_box.Right() == border_image_length &&
          border_image_length_box.Top() == border_image_length &&
          border_image_length_box.Bottom() == border_image_length);
}
inline bool LengthMatchesAllSides(const LengthBox& length_box,
                                  const Length& length) {
  return (length_box.Left() == length && length_box.Right() == length &&
          length_box.Top() == length && length_box.Bottom() == length);
}

}  // namespace StyleBuildingUtils
}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_CSS_PROPERTIES_STYLE_BUILDING_UTILS_H_