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 #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 19 matching lines...) Expand all Loading... |
30 | 30 |
31 void ScrollAnchor::setScroller(ScrollableArea* scroller) { | 31 void ScrollAnchor::setScroller(ScrollableArea* scroller) { |
32 DCHECK(m_scroller != scroller); | 32 DCHECK(m_scroller != scroller); |
33 DCHECK(scroller); | 33 DCHECK(scroller); |
34 DCHECK(scroller->isRootFrameViewport() || scroller->isFrameView() || | 34 DCHECK(scroller->isRootFrameViewport() || scroller->isFrameView() || |
35 scroller->isPaintLayerScrollableArea()); | 35 scroller->isPaintLayerScrollableArea()); |
36 m_scroller = scroller; | 36 m_scroller = scroller; |
37 clear(); | 37 clear(); |
38 } | 38 } |
39 | 39 |
40 // TODO(pilgrim) replace all instances of scrollerLayoutBox with scrollerLayoutB
oxItem | 40 // TODO(pilgrim): Replace all instances of scrollerLayoutBox with |
41 // https://crbug.com/499321 | 41 // scrollerLayoutBoxItem, https://crbug.com/499321 |
42 static LayoutBox* scrollerLayoutBox(const ScrollableArea* scroller) { | 42 static LayoutBox* scrollerLayoutBox(const ScrollableArea* scroller) { |
43 LayoutBox* box = scroller->layoutBox(); | 43 LayoutBox* box = scroller->layoutBox(); |
44 DCHECK(box); | 44 DCHECK(box); |
45 return box; | 45 return box; |
46 } | 46 } |
47 | 47 |
48 static LayoutBoxItem scrollerLayoutBoxItem(const ScrollableArea* scroller) { | 48 static LayoutBoxItem scrollerLayoutBoxItem(const ScrollableArea* scroller) { |
49 return LayoutBoxItem(scrollerLayoutBox(scroller)); | 49 return LayoutBoxItem(scrollerLayoutBox(scroller)); |
50 } | 50 } |
51 | 51 |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 bool ScrollAnchor::refersTo(const LayoutObject* layoutObject) const { | 309 bool ScrollAnchor::refersTo(const LayoutObject* layoutObject) const { |
310 return m_anchorObject == layoutObject; | 310 return m_anchorObject == layoutObject; |
311 } | 311 } |
312 | 312 |
313 void ScrollAnchor::notifyRemoved(LayoutObject* layoutObject) { | 313 void ScrollAnchor::notifyRemoved(LayoutObject* layoutObject) { |
314 if (m_anchorObject == layoutObject) | 314 if (m_anchorObject == layoutObject) |
315 clear(); | 315 clear(); |
316 } | 316 } |
317 | 317 |
318 } // namespace blink | 318 } // namespace blink |
OLD | NEW |