Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(694)

Unified Diff: third_party/WebKit/Source/core/style/ScrollSnapPoints.h

Issue 2767213003: First Implementation of Snapped Points
Patch Set: Rebase and format Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/style/ScrollSnapPoints.h
diff --git a/third_party/WebKit/Source/core/style/ScrollSnapPoints.h b/third_party/WebKit/Source/core/style/ScrollSnapPoints.h
index 473265b60494c6c62c302e845b74e13659b946e0..34537c1bb134d9f507c1a2fa354ed00e84cb8047 100644
--- a/third_party/WebKit/Source/core/style/ScrollSnapPoints.h
+++ b/third_party/WebKit/Source/core/style/ScrollSnapPoints.h
@@ -30,6 +30,84 @@ struct ScrollSnapPoints {
bool uses_elements;
};
+struct ScrollSnapType {
+ DISALLOW_NEW();
+
+ ScrollSnapType()
+ : axis(kSnapAxisNone), strictness(kSnapStrictnessProximity) {}
+
+ 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) {}
+
+ 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 ScrollSnapPadding {
+ DISALLOW_NEW();
+
+ ScrollSnapPadding()
+ : top(kFixed), right(kFixed), bottom(kFixed), left(kFixed) {}
+
+ bool operator==(const ScrollSnapPadding& other) const {
+ return top == other.top && right == other.right && bottom == other.bottom &&
+ left == other.left;
+ }
+
+ bool operator!=(const ScrollSnapPadding& 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) {}
+
+ 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;
+};
+
} // namespace blink
#endif // ScrollSnapPoints_h

Powered by Google App Engine
This is Rietveld 408576698