| 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..aca07b47c18cc68cb0342a130c82059b1753235d 100644
|
| --- a/third_party/WebKit/Source/core/style/StyleScrollSnapData.h
|
| +++ b/third_party/WebKit/Source/core/style/StyleScrollSnapData.h
|
| @@ -26,7 +26,7 @@
|
| #ifndef StyleScrollSnapData_h
|
| #define StyleScrollSnapData_h
|
|
|
| -#include "core/style/ScrollSnapPoints.h"
|
| +#include "core/style/ComputedStyleConstants.h"
|
| #include "platform/LengthPoint.h"
|
| #include "platform/wtf/Allocator.h"
|
| #include "platform/wtf/RefCounted.h"
|
| @@ -34,6 +34,107 @@
|
|
|
| namespace blink {
|
|
|
| +struct ScrollSnapType {
|
| + DISALLOW_NEW();
|
| +
|
| + ScrollSnapType()
|
| + : axis(kSnapAxisNone), strictness(kSnapStrictnessProximity) {}
|
| +
|
| + ScrollSnapType(const ScrollSnapType& other)
|
| + : axis(other.axis), strictness(other.strictness) {}
|
| +
|
| + bool operator==(const ScrollSnapType& other) const {
|
| + return axis == other.axis && strictness == other.strictness;
|
| + }
|
| +
|
| + bool operator!=(const ScrollSnapType& other) const {
|
| + return !(*this == other);
|
| + }
|
| +
|
| + 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;
|
| +};
|
| +
|
| +struct ScrollPadding {
|
| + DISALLOW_NEW();
|
| +
|
| + ScrollPadding() : top(kFixed), right(kFixed), bottom(kFixed), left(kFixed) {}
|
| +
|
| + explicit ScrollPadding(Length length)
|
| + : top(length), right(length), bottom(length), left(length) {}
|
| +
|
| + ScrollPadding(const ScrollPadding& other)
|
| + : top(other.top),
|
| + right(other.right),
|
| + bottom(other.bottom),
|
| + left(other.left) {}
|
| +
|
| + bool operator==(const ScrollPadding& other) const {
|
| + return top == other.top && right == other.right && bottom == other.bottom &&
|
| + left == other.left;
|
| + }
|
| +
|
| + bool operator!=(const ScrollPadding& other) const {
|
| + return !(*this == other);
|
| + }
|
| +
|
| + Length top;
|
| + Length right;
|
| + Length bottom;
|
| + Length left;
|
| +};
|
| +
|
| +struct ScrollSnapMargin {
|
| + DISALLOW_NEW();
|
| +
|
| + ScrollSnapMargin()
|
| + : top(kFixed), right(kFixed), bottom(kFixed), left(kFixed) {}
|
| +
|
| + explicit ScrollSnapMargin(Length length)
|
| + : top(length), right(length), bottom(length), left(length) {}
|
| +
|
| + ScrollSnapMargin(const ScrollSnapMargin& other)
|
| + : top(other.top),
|
| + right(other.right),
|
| + bottom(other.bottom),
|
| + left(other.left) {}
|
| +
|
| + bool operator==(const ScrollSnapMargin& other) const {
|
| + return top == other.top && right == other.right && bottom == other.bottom &&
|
| + left == other.left;
|
| + }
|
| +
|
| + bool operator!=(const ScrollSnapMargin& other) const {
|
| + return !(*this == other);
|
| + }
|
| +
|
| + Length top;
|
| + Length right;
|
| + Length bottom;
|
| + Length left;
|
| +};
|
| +
|
| class StyleScrollSnapData : public RefCounted<StyleScrollSnapData> {
|
| public:
|
| static PassRefPtr<StyleScrollSnapData> Create() {
|
| @@ -43,14 +144,15 @@ 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_;
|
| + EScrollSnapStop stop_;
|
|
|
| private:
|
| StyleScrollSnapData();
|
| - StyleScrollSnapData(const StyleScrollSnapData&);
|
| + StyleScrollSnapData(const StyleScrollSnapData& other);
|
| };
|
|
|
| bool operator==(const StyleScrollSnapData&, const StyleScrollSnapData&);
|
|
|