Index: third_party/WebKit/Source/core/style/StyleScrollSnapData.h |
diff --git a/third_party/WebKit/Source/core/style/StyleScrollSnapData.h b/third_party/WebKit/Source/core/style/StyleScrollSnapData.h |
index 517f57b52660b114a6c33e07baa4ff1533141b97..ea02b9773b43b789b48e669ce84840b3d05d17d7 100644 |
--- a/third_party/WebKit/Source/core/style/StyleScrollSnapData.h |
+++ b/third_party/WebKit/Source/core/style/StyleScrollSnapData.h |
@@ -26,7 +26,8 @@ |
#ifndef StyleScrollSnapData_h |
#define StyleScrollSnapData_h |
-#include "core/style/ScrollSnapPoints.h" |
+#include "core/style/ComputedStyleConstants.h" |
+#include "core/style/QuadLengthValue.h" |
#include "platform/LengthPoint.h" |
#include "platform/wtf/Allocator.h" |
#include "platform/wtf/RefCounted.h" |
@@ -34,6 +35,57 @@ |
namespace blink { |
+using ScrollPadding = QuadLengthValue; |
+using ScrollSnapMargin = QuadLengthValue; |
+ |
+struct ScrollSnapType { |
+ DISALLOW_NEW(); |
+ |
+ ScrollSnapType() |
+ : is_none(true), |
+ axis(kSnapAxisBoth), |
+ strictness(kSnapStrictnessProximity) {} |
+ |
+ ScrollSnapType(const ScrollSnapType& other) |
+ : is_none(other.is_none), |
+ axis(other.axis), |
+ strictness(other.strictness) {} |
+ |
+ bool operator==(const ScrollSnapType& other) const { |
+ return is_none == other.is_none && axis == other.axis && |
+ strictness == other.strictness; |
+ } |
+ |
+ bool operator!=(const ScrollSnapType& other) const { |
+ return !(*this == other); |
+ } |
+ |
+ bool is_none; |
+ SnapAxis axis; |
+ SnapStrictness strictness; |
+}; |
+ |
+struct ScrollSnapAlign { |
+ DISALLOW_NEW(); |
+ |
+ ScrollSnapAlign() |
+ : alignmentX(kSnapAlignmentNone), alignmentY(kSnapAlignmentNone) {} |
+ |
+ ScrollSnapAlign(const ScrollSnapAlign& other) |
+ : alignmentX(other.alignmentX), alignmentY(other.alignmentY) {} |
+ |
+ bool operator==(const ScrollSnapAlign& other) const { |
+ return alignmentX == other.alignmentX && alignmentY == other.alignmentY; |
+ } |
+ |
+ bool operator!=(const ScrollSnapAlign& other) const { |
+ return !(*this == other); |
+ } |
+ |
+ SnapAlignment alignmentX; |
+ SnapAlignment alignmentY; |
+}; |
+ |
class StyleScrollSnapData : public RefCounted<StyleScrollSnapData> { |
public: |
static PassRefPtr<StyleScrollSnapData> Create() { |
@@ -43,14 +95,14 @@ class StyleScrollSnapData : public RefCounted<StyleScrollSnapData> { |
return AdoptRef(new StyleScrollSnapData(*this)); |
} |
- ScrollSnapPoints x_points_; |
- ScrollSnapPoints y_points_; |
- LengthPoint destination_; |
- Vector<LengthPoint> coordinates_; |
+ ScrollSnapType type_; |
+ ScrollSnapAlign align_; |
+ ScrollPadding padding_; |
+ ScrollSnapMargin margin_; |
private: |
StyleScrollSnapData(); |
- StyleScrollSnapData(const StyleScrollSnapData&); |
+ StyleScrollSnapData(const StyleScrollSnapData& other); |
}; |
bool operator==(const StyleScrollSnapData&, const StyleScrollSnapData&); |