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

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

Issue 2561973002: Changed EOverflowAnchor to an enum class and renamed its members (Closed)
Patch Set: Created 4 years 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
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 #include "core/layout/ScrollAnchor.h" 5 #include "core/layout/ScrollAnchor.h"
6 6
7 #include "core/frame/FrameView.h" 7 #include "core/frame/FrameView.h"
8 #include "core/frame/UseCounter.h" 8 #include "core/frame/UseCounter.h"
9 #include "core/layout/LayoutBlockFlow.h" 9 #include "core/layout/LayoutBlockFlow.h"
10 #include "core/layout/api/LayoutBoxItem.h" 10 #include "core/layout/api/LayoutBoxItem.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 // developers to reason about the anchor node. 133 // developers to reason about the anchor node.
134 if (candidate->isAnonymous()) 134 if (candidate->isAnonymous())
135 return ExamineResult(Continue); 135 return ExamineResult(Continue);
136 136
137 if (!candidate->isText() && !candidate->isBox()) 137 if (!candidate->isText() && !candidate->isBox())
138 return ExamineResult(Skip); 138 return ExamineResult(Skip);
139 139
140 if (!candidateMayMoveWithScroller(candidate, m_scroller)) 140 if (!candidateMayMoveWithScroller(candidate, m_scroller))
141 return ExamineResult(Skip); 141 return ExamineResult(Skip);
142 142
143 if (candidate->style()->overflowAnchor() == AnchorNone) 143 if (candidate->style()->overflowAnchor() == EOverflowAnchor::None)
144 return ExamineResult(Skip); 144 return ExamineResult(Skip);
145 145
146 LayoutRect candidateRect = relativeBounds(candidate, m_scroller); 146 LayoutRect candidateRect = relativeBounds(candidate, m_scroller);
147 LayoutRect visibleRect = 147 LayoutRect visibleRect =
148 scrollerLayoutBoxItem(m_scroller).overflowClipRect(LayoutPoint()); 148 scrollerLayoutBoxItem(m_scroller).overflowClipRect(LayoutPoint());
149 149
150 bool occupiesSpace = candidateRect.width() > 0 && candidateRect.height() > 0; 150 bool occupiesSpace = candidateRect.width() > 0 && candidateRect.height() > 0;
151 if (occupiesSpace && visibleRect.intersects(candidateRect)) { 151 if (occupiesSpace && visibleRect.intersects(candidateRect)) {
152 return ExamineResult( 152 return ExamineResult(
153 visibleRect.contains(candidateRect) ? Return : Constrain, 153 visibleRect.contains(candidateRect) ? Return : Constrain,
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 bool ScrollAnchor::refersTo(const LayoutObject* layoutObject) const { 330 bool ScrollAnchor::refersTo(const LayoutObject* layoutObject) const {
331 return m_anchorObject == layoutObject; 331 return m_anchorObject == layoutObject;
332 } 332 }
333 333
334 void ScrollAnchor::notifyRemoved(LayoutObject* layoutObject) { 334 void ScrollAnchor::notifyRemoved(LayoutObject* layoutObject) {
335 if (m_anchorObject == layoutObject) 335 if (m_anchorObject == layoutObject)
336 clearSelf(); 336 clearSelf();
337 } 337 }
338 338
339 } // namespace blink 339 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.cpp ('k') | third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698