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

Side by Side Diff: third_party/WebKit/Source/core/layout/ScrollAnchor.h

Issue 2304493002: Ignore redundant calls to ScrollAnchor::save. (Closed)
Patch Set: add TODO; skip restore if !m_saved Created 4 years, 3 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 | « no previous file | third_party/WebKit/Source/core/layout/ScrollAnchor.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/ScrollAnchor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698