| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ScrollSnapPoints_h | 5 #ifndef ScrollSnapPoints_h |
| 6 #define ScrollSnapPoints_h | 6 #define ScrollSnapPoints_h |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include "platform/Length.h" | 9 #include "platform/Length.h" |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 } | 23 } |
| 24 bool operator!=(const ScrollSnapPoints& other) const { | 24 bool operator!=(const ScrollSnapPoints& other) const { |
| 25 return !(*this == other); | 25 return !(*this == other); |
| 26 } | 26 } |
| 27 | 27 |
| 28 Length repeat_offset; | 28 Length repeat_offset; |
| 29 bool has_repeat; | 29 bool has_repeat; |
| 30 bool uses_elements; | 30 bool uses_elements; |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 struct ScrollSnapType { |
| 34 DISALLOW_NEW(); |
| 35 |
| 36 ScrollSnapType() |
| 37 : axis(kSnapAxisNone), strictness(kSnapStrictnessProximity) {} |
| 38 |
| 39 bool operator==(const ScrollSnapType& other) const { |
| 40 return axis == other.axis && strictness == other.strictness; |
| 41 } |
| 42 |
| 43 bool operator!=(const ScrollSnapType& other) const { |
| 44 return !(*this == other); |
| 45 } |
| 46 |
| 47 SnapAxis axis; |
| 48 SnapStrictness strictness; |
| 49 }; |
| 50 |
| 51 struct ScrollSnapAlign { |
| 52 DISALLOW_NEW(); |
| 53 |
| 54 ScrollSnapAlign() |
| 55 : alignmentX(kSnapAlignmentNone), alignmentY(kSnapAlignmentNone) {} |
| 56 |
| 57 bool operator==(const ScrollSnapAlign& other) const { |
| 58 return alignmentX == other.alignmentX && alignmentY == other.alignmentY; |
| 59 } |
| 60 |
| 61 bool operator!=(const ScrollSnapAlign& other) const { |
| 62 return !(*this == other); |
| 63 } |
| 64 |
| 65 SnapAlignment alignmentX; |
| 66 SnapAlignment alignmentY; |
| 67 }; |
| 68 |
| 69 struct ScrollSnapPadding { |
| 70 DISALLOW_NEW(); |
| 71 |
| 72 ScrollSnapPadding() |
| 73 : top(kFixed), right(kFixed), bottom(kFixed), left(kFixed) {} |
| 74 |
| 75 bool operator==(const ScrollSnapPadding& other) const { |
| 76 return top == other.top && right == other.right && bottom == other.bottom && |
| 77 left == other.left; |
| 78 } |
| 79 |
| 80 bool operator!=(const ScrollSnapPadding& other) const { |
| 81 return !(*this == other); |
| 82 } |
| 83 |
| 84 Length top; |
| 85 Length right; |
| 86 Length bottom; |
| 87 Length left; |
| 88 }; |
| 89 |
| 90 struct ScrollSnapMargin { |
| 91 DISALLOW_NEW(); |
| 92 |
| 93 ScrollSnapMargin() |
| 94 : top(kFixed), right(kFixed), bottom(kFixed), left(kFixed) {} |
| 95 |
| 96 bool operator==(const ScrollSnapMargin& other) const { |
| 97 return top == other.top && right == other.right && bottom == other.bottom && |
| 98 left == other.left; |
| 99 } |
| 100 |
| 101 bool operator!=(const ScrollSnapMargin& other) const { |
| 102 return !(*this == other); |
| 103 } |
| 104 |
| 105 Length top; |
| 106 Length right; |
| 107 Length bottom; |
| 108 Length left; |
| 109 }; |
| 110 |
| 33 } // namespace blink | 111 } // namespace blink |
| 34 | 112 |
| 35 #endif // ScrollSnapPoints_h | 113 #endif // ScrollSnapPoints_h |
| OLD | NEW |