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

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

Issue 1958973004: Always anchor to top of the anchor element (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 4 years, 7 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 23 matching lines...) Expand all
34 void save(); 34 void save();
35 35
36 // Scrolls to compensate for any change in the anchor's relative location 36 // Scrolls to compensate for any change in the anchor's relative location
37 // since the most recent call to save(). Should be called immediately after 37 // since the most recent call to save(). Should be called immediately after
38 // the scroller has been laid out. 38 // the scroller has been laid out.
39 void restore(); 39 void restore();
40 40
41 enum class Corner { 41 enum class Corner {
42 TopLeft = 0, 42 TopLeft = 0,
43 TopRight, 43 TopRight,
44 BottomLeft,
45 BottomRight
46 }; 44 };
47 // Which corner of the anchor object we are currently anchored to. 45 // Which corner of the anchor object we are currently anchored to.
48 // Only meaningful if anchorObject() is non-null. 46 // Only meaningful if anchorObject() is non-null.
49 Corner corner() const { return m_corner; } 47 Corner corner() const { return m_corner; }
50 48
51 DEFINE_INLINE_TRACE() { visitor->trace(m_scroller); } 49 DEFINE_INLINE_TRACE() { visitor->trace(m_scroller); }
52 50
53 private: 51 private:
54 void findAnchor(); 52 void findAnchor();
55 53
(...skipping 29 matching lines...) Expand all
85 // Which corner of m_anchorObject's bounding box to anchor to. 83 // Which corner of m_anchorObject's bounding box to anchor to.
86 Corner m_corner; 84 Corner m_corner;
87 85
88 // Location of m_layoutObject relative to scroller at time of save(). 86 // Location of m_layoutObject relative to scroller at time of save().
89 LayoutPoint m_savedRelativeOffset; 87 LayoutPoint m_savedRelativeOffset;
90 }; 88 };
91 89
92 } // namespace blink 90 } // namespace blink
93 91
94 #endif // ScrollAnchor_h 92 #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