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

Side by Side Diff: third_party/WebKit/Source/core/page/scrolling/StickyPositionScrollingConstraints.h

Issue 2251303003: Implement position: sticky updates on compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with master and add comments to WebLayerStickyPositionConstraint members. Created 4 years, 2 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 StickyPositionScrollingConstraints_h 5 #ifndef StickyPositionScrollingConstraints_h
6 #define StickyPositionScrollingConstraints_h 6 #define StickyPositionScrollingConstraints_h
7 7
8 #include "platform/geometry/FloatRect.h" 8 #include "platform/geometry/FloatRect.h"
9 9
10 namespace blink { 10 namespace blink {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 float rightOffset() const { return m_rightOffset; } 50 float rightOffset() const { return m_rightOffset; }
51 float topOffset() const { return m_topOffset; } 51 float topOffset() const { return m_topOffset; }
52 float bottomOffset() const { return m_bottomOffset; } 52 float bottomOffset() const { return m_bottomOffset; }
53 53
54 void setLeftOffset(float offset) { m_leftOffset = offset; } 54 void setLeftOffset(float offset) { m_leftOffset = offset; }
55 void setRightOffset(float offset) { m_rightOffset = offset; } 55 void setRightOffset(float offset) { m_rightOffset = offset; }
56 void setTopOffset(float offset) { m_topOffset = offset; } 56 void setTopOffset(float offset) { m_topOffset = offset; }
57 void setBottomOffset(float offset) { m_bottomOffset = offset; } 57 void setBottomOffset(float offset) { m_bottomOffset = offset; }
58 58
59 void setScrollContainerRelativeContainingBlockRect(const FloatRect& rect) { m_scrollContainerRelativeContainingBlockRect = rect; } 59 void setScrollContainerRelativeContainingBlockRect(const FloatRect& rect) { m_scrollContainerRelativeContainingBlockRect = rect; }
60 const FloatRect& scrollContainerRelativeContainingBlockRect() const { return m_scrollContainerRelativeContainingBlockRect; }
60 61
61 void setScrollContainerRelativeStickyBoxRect(const FloatRect& rect) { m_scro llContainerRelativeStickyBoxRect = rect; } 62 void setScrollContainerRelativeStickyBoxRect(const FloatRect& rect) { m_scro llContainerRelativeStickyBoxRect = rect; }
63 const FloatRect& scrollContainerRelativeStickyBoxRect() const { return m_scr ollContainerRelativeStickyBoxRect; }
62 64
63 bool operator==(const StickyPositionScrollingConstraints& other) const 65 bool operator==(const StickyPositionScrollingConstraints& other) const
64 { 66 {
65 return m_leftOffset == other.m_leftOffset 67 return m_leftOffset == other.m_leftOffset
66 && m_rightOffset == other.m_rightOffset 68 && m_rightOffset == other.m_rightOffset
67 && m_topOffset == other.m_topOffset 69 && m_topOffset == other.m_topOffset
68 && m_bottomOffset == other.m_bottomOffset 70 && m_bottomOffset == other.m_bottomOffset
69 && m_scrollContainerRelativeContainingBlockRect == other.m_scrollCon tainerRelativeContainingBlockRect 71 && m_scrollContainerRelativeContainingBlockRect == other.m_scrollCon tainerRelativeContainingBlockRect
70 && m_scrollContainerRelativeStickyBoxRect == other.m_scrollContainer RelativeStickyBoxRect; 72 && m_scrollContainerRelativeStickyBoxRect == other.m_scrollContainer RelativeStickyBoxRect;
71 } 73 }
72 74
73 bool operator!=(const StickyPositionScrollingConstraints& other) const { ret urn !(*this == other); } 75 bool operator!=(const StickyPositionScrollingConstraints& other) const { ret urn !(*this == other); }
74 76
75 private: 77 private:
76 friend class LayoutBoxModelObjectTest;
77
78 const FloatRect& scrollContainerRelativeContainingBlockRect() const { return m_scrollContainerRelativeContainingBlockRect; }
79 const FloatRect& scrollContainerRelativeStickyBoxRect() const { return m_scr ollContainerRelativeStickyBoxRect; }
80
81 AnchorEdges m_anchorEdges; 78 AnchorEdges m_anchorEdges;
82 float m_leftOffset; 79 float m_leftOffset;
83 float m_rightOffset; 80 float m_rightOffset;
84 float m_topOffset; 81 float m_topOffset;
85 float m_bottomOffset; 82 float m_bottomOffset;
86 FloatRect m_scrollContainerRelativeContainingBlockRect; 83 FloatRect m_scrollContainerRelativeContainingBlockRect;
87 FloatRect m_scrollContainerRelativeStickyBoxRect; 84 FloatRect m_scrollContainerRelativeStickyBoxRect;
88 }; 85 };
89 86
90 } // namespace blink 87 } // namespace blink
91 88
92 #endif // StickyPositionScrollingConstraints_h 89 #endif // StickyPositionScrollingConstraints_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698