| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 ScrollAnchor_h | 5 #ifndef ScrollAnchor_h |
| 6 #define ScrollAnchor_h | 6 #define ScrollAnchor_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "platform/geometry/LayoutPoint.h" | 9 #include "platform/geometry/LayoutPoint.h" |
| 10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 bool refersTo(const LayoutObject*) const; | 59 bool refersTo(const LayoutObject*) const; |
| 60 | 60 |
| 61 // Notifies us that an object will be removed from the layout tree. | 61 // Notifies us that an object will be removed from the layout tree. |
| 62 void notifyRemoved(LayoutObject*); | 62 void notifyRemoved(LayoutObject*); |
| 63 | 63 |
| 64 DEFINE_INLINE_TRACE() { visitor->trace(m_scroller); } | 64 DEFINE_INLINE_TRACE() { visitor->trace(m_scroller); } |
| 65 | 65 |
| 66 private: | 66 private: |
| 67 void findAnchor(); | 67 void findAnchor(); |
| 68 | 68 |
| 69 bool paddingOrBorderChanged() const; |
| 70 |
| 69 enum WalkStatus { | 71 enum WalkStatus { |
| 70 Skip = 0, | 72 Skip = 0, |
| 71 Constrain, | 73 Constrain, |
| 72 Continue, | 74 Continue, |
| 73 Return | 75 Return |
| 74 }; | 76 }; |
| 75 struct ExamineResult { | 77 struct ExamineResult { |
| 76 ExamineResult(WalkStatus s) | 78 ExamineResult(WalkStatus s) |
| 77 : status(s) | 79 : status(s) |
| 78 , viable(false) | 80 , viable(false) |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 127 |
| 126 // The size of the most recent non-zero adjustment. | 128 // The size of the most recent non-zero adjustment. |
| 127 IntSize m_lastAdjustment; | 129 IntSize m_lastAdjustment; |
| 128 | 130 |
| 129 // True iff the last adjustment was the exact opposite of the one before it. | 131 // True iff the last adjustment was the exact opposite of the one before it. |
| 130 // A bounce suggests a circular interaction with a scroll event handler. | 132 // A bounce suggests a circular interaction with a scroll event handler. |
| 131 bool m_hasBounced; | 133 bool m_hasBounced; |
| 132 | 134 |
| 133 // Number of adjustments made since the last clear(). | 135 // Number of adjustments made since the last clear(). |
| 134 int m_adjustmentCount; | 136 int m_adjustmentCount; |
| 137 |
| 138 // Whether any of the ancestors had their border/padding modified in the |
| 139 // layout pass that triggered scroll anchoring. |
| 140 bool m_anyAncestorChangedPaddingOrMargin; |
| 135 }; | 141 }; |
| 136 | 142 |
| 137 } // namespace blink | 143 } // namespace blink |
| 138 | 144 |
| 139 #endif // ScrollAnchor_h | 145 #endif // ScrollAnchor_h |
| OLD | NEW |