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

Side by Side Diff: third_party/WebKit/Source/core/style/StyleScrollSnapData.cpp

Issue 2913403002: Move ScrollSnapPoints to its own file. (Closed)
Patch Set: Rebase 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/style/StyleScrollSnapData.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2014 Apple Inc. All rights reserved. 2 * Copyright (C) 2014 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 11 matching lines...) Expand all
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23 * THE POSSIBILITY OF SUCH DAMAGE. 23 * THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #include "core/style/StyleScrollSnapData.h" 26 #include "core/style/StyleScrollSnapData.h"
27 27
28 #include "core/style/ComputedStyle.h" 28 #include "core/style/ComputedStyle.h"
29 29
30 namespace blink { 30 namespace blink {
31 31
32 ScrollSnapPoints::ScrollSnapPoints()
33 : repeat_offset(100, kPercent), has_repeat(false), uses_elements(false) {}
34
35 bool operator==(const ScrollSnapPoints& a, const ScrollSnapPoints& b) {
36 return a.repeat_offset == b.repeat_offset && a.has_repeat == b.has_repeat &&
37 a.uses_elements == b.uses_elements;
38 }
39
40 StyleScrollSnapData::StyleScrollSnapData() 32 StyleScrollSnapData::StyleScrollSnapData()
41 : x_points_(ComputedStyle::InitialScrollSnapPointsX()), 33 : x_points_(ComputedStyle::InitialScrollSnapPointsX()),
42 y_points_(ComputedStyle::InitialScrollSnapPointsY()), 34 y_points_(ComputedStyle::InitialScrollSnapPointsY()),
43 destination_(ComputedStyle::InitialScrollSnapDestination()), 35 destination_(ComputedStyle::InitialScrollSnapDestination()),
44 coordinates_(ComputedStyle::InitialScrollSnapCoordinate()) {} 36 coordinates_(ComputedStyle::InitialScrollSnapCoordinate()) {}
45 37
46 StyleScrollSnapData::StyleScrollSnapData(const StyleScrollSnapData& other) 38 StyleScrollSnapData::StyleScrollSnapData(const StyleScrollSnapData& other)
47 : x_points_(other.x_points_), 39 : x_points_(other.x_points_),
48 y_points_(other.y_points_), 40 y_points_(other.y_points_),
49 destination_(other.destination_), 41 destination_(other.destination_),
50 coordinates_(other.coordinates_) {} 42 coordinates_(other.coordinates_) {}
51 43
52 bool operator==(const StyleScrollSnapData& a, const StyleScrollSnapData& b) { 44 bool operator==(const StyleScrollSnapData& a, const StyleScrollSnapData& b) {
53 return a.x_points_ == b.x_points_ && a.y_points_ == b.y_points_ && 45 return a.x_points_ == b.x_points_ && a.y_points_ == b.y_points_ &&
54 a.destination_ == b.destination_ && a.coordinates_ == b.coordinates_; 46 a.destination_ == b.destination_ && a.coordinates_ == b.coordinates_;
55 } 47 }
56 48
57 } // namespace blink 49 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/style/StyleScrollSnapData.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698