| 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 103 |
| 104 // Location of m_layoutObject relative to scroller at time of save(). | 104 // Location of m_layoutObject relative to scroller at time of save(). |
| 105 LayoutPoint m_savedRelativeOffset; | 105 LayoutPoint m_savedRelativeOffset; |
| 106 | 106 |
| 107 // We suppress scroll anchoring after a style change on the anchor node or | 107 // We suppress scroll anchoring after a style change on the anchor node or |
| 108 // one of its ancestors, if that change might have caused the node to move. | 108 // one of its ancestors, if that change might have caused the node to move. |
| 109 // This bit tracks whether we have had a scroll-anchor-disabling style | 109 // This bit tracks whether we have had a scroll-anchor-disabling style |
| 110 // change since the last layout. It is recomputed in save(), and used to | 110 // change since the last layout. It is recomputed in save(), and used to |
| 111 // suppress the adjustment in restore(). More at http://bit.ly/sanaclap. | 111 // suppress the adjustment in restore(). More at http://bit.ly/sanaclap. |
| 112 bool m_scrollAnchorDisablingStyleChanged; | 112 bool m_scrollAnchorDisablingStyleChanged; |
| 113 |
| 114 // True iff save has been called, and restore has not been called since |
| 115 // the call to save. In this state, additional calls to save are ignored, |
| 116 // to make things easier for multi-pass layout modes such as flexbox. |
| 117 // TODO(skobes): explore anchoring at frame boundaries instead of layouts, |
| 118 // which would allow this field to be removed. |
| 119 bool m_saved; |
| 113 }; | 120 }; |
| 114 | 121 |
| 115 } // namespace blink | 122 } // namespace blink |
| 116 | 123 |
| 117 #endif // ScrollAnchor_h | 124 #endif // ScrollAnchor_h |
| OLD | NEW |