Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 48 float rightOffset() const { return m_rightOffset; } | 48 float rightOffset() const { return m_rightOffset; } |
| 49 float topOffset() const { return m_topOffset; } | 49 float topOffset() const { return m_topOffset; } |
| 50 float bottomOffset() const { return m_bottomOffset; } | 50 float bottomOffset() const { return m_bottomOffset; } |
| 51 | 51 |
| 52 void setLeftOffset(float offset) { m_leftOffset = offset; } | 52 void setLeftOffset(float offset) { m_leftOffset = offset; } |
| 53 void setRightOffset(float offset) { m_rightOffset = offset; } | 53 void setRightOffset(float offset) { m_rightOffset = offset; } |
| 54 void setTopOffset(float offset) { m_topOffset = offset; } | 54 void setTopOffset(float offset) { m_topOffset = offset; } |
| 55 void setBottomOffset(float offset) { m_bottomOffset = offset; } | 55 void setBottomOffset(float offset) { m_bottomOffset = offset; } |
| 56 | 56 |
| 57 void setScrollContainerRelativeContainingBlockRect(const FloatRect& rect) { m_scrollContainerRelativeContainingBlockRect = rect; } | 57 void setScrollContainerRelativeContainingBlockRect(const FloatRect& rect) { m_scrollContainerRelativeContainingBlockRect = rect; } |
| 58 const FloatRect& scrollContainerRelativeContainingBlockRect() const { return m_scrollContainerRelativeContainingBlockRect; } | |
|
chrishtr
2016/06/16 11:03:59
These new methods are only used in tests. Make the
flackr
2016/06/29 13:21:06
Done.
| |
| 58 | 59 |
| 59 void setScrollContainerRelativeStickyBoxRect(const FloatRect& rect) { m_scro llContainerRelativeStickyBoxRect = rect; } | 60 void setScrollContainerRelativeStickyBoxRect(const FloatRect& rect) { m_scro llContainerRelativeStickyBoxRect = rect; } |
| 61 const FloatRect& scrollContainerRelativeStickyBoxRect() const { return m_scr ollContainerRelativeStickyBoxRect; } | |
| 60 | 62 |
| 61 bool operator==(const StickyPositionScrollingConstraints& other) const | 63 bool operator==(const StickyPositionScrollingConstraints& other) const |
| 62 { | 64 { |
| 63 return m_leftOffset == other.m_leftOffset | 65 return m_leftOffset == other.m_leftOffset |
| 64 && m_rightOffset == other.m_rightOffset | 66 && m_rightOffset == other.m_rightOffset |
| 65 && m_topOffset == other.m_topOffset | 67 && m_topOffset == other.m_topOffset |
| 66 && m_bottomOffset == other.m_bottomOffset | 68 && m_bottomOffset == other.m_bottomOffset |
| 67 && m_scrollContainerRelativeContainingBlockRect == other.m_scrollCon tainerRelativeContainingBlockRect | 69 && m_scrollContainerRelativeContainingBlockRect == other.m_scrollCon tainerRelativeContainingBlockRect |
| 68 && m_scrollContainerRelativeStickyBoxRect == other.m_scrollContainer RelativeStickyBoxRect; | 70 && m_scrollContainerRelativeStickyBoxRect == other.m_scrollContainer RelativeStickyBoxRect; |
| 69 } | 71 } |
| 70 | 72 |
| 71 bool operator!=(const StickyPositionScrollingConstraints& other) const { ret urn !(*this == other); } | 73 bool operator!=(const StickyPositionScrollingConstraints& other) const { ret urn !(*this == other); } |
| 72 | 74 |
| 73 private: | 75 private: |
| 74 AnchorEdges m_anchorEdges; | 76 AnchorEdges m_anchorEdges; |
| 75 float m_leftOffset; | 77 float m_leftOffset; |
| 76 float m_rightOffset; | 78 float m_rightOffset; |
| 77 float m_topOffset; | 79 float m_topOffset; |
| 78 float m_bottomOffset; | 80 float m_bottomOffset; |
| 79 FloatRect m_scrollContainerRelativeContainingBlockRect; | 81 FloatRect m_scrollContainerRelativeContainingBlockRect; |
| 80 FloatRect m_scrollContainerRelativeStickyBoxRect; | 82 FloatRect m_scrollContainerRelativeStickyBoxRect; |
| 81 }; | 83 }; |
| 82 | 84 |
| 83 } // namespace blink | 85 } // namespace blink |
| 84 | 86 |
| 85 #endif // StickyPositionScrollingConstraints_h | 87 #endif // StickyPositionScrollingConstraints_h |
| OLD | NEW |