OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/page/scrolling/TopDocumentRootScrollerController.h" | 5 #include "core/page/scrolling/TopDocumentRootScrollerController.h" |
6 | 6 |
7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
8 #include "core/dom/Element.h" | 8 #include "core/dom/Element.h" |
9 #include "core/frame/FrameHost.h" | 9 #include "core/frame/FrameHost.h" |
10 #include "core/frame/FrameView.h" | 10 #include "core/frame/FrameView.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 } | 62 } |
63 | 63 |
64 return element; | 64 return element; |
65 } | 65 } |
66 | 66 |
67 void TopDocumentRootScrollerController::recomputeGlobalRootScroller() { | 67 void TopDocumentRootScrollerController::recomputeGlobalRootScroller() { |
68 if (!m_viewportApplyScroll) | 68 if (!m_viewportApplyScroll) |
69 return; | 69 return; |
70 | 70 |
71 Element* target = findGlobalRootScrollerElement(); | 71 Element* target = findGlobalRootScrollerElement(); |
72 if (!target) | 72 if (!target || target == m_globalRootScroller) |
73 return; | 73 return; |
74 | 74 |
75 ScrollableArea* targetScroller = RootScrollerUtil::scrollableAreaFor(*target); | 75 ScrollableArea* targetScroller = RootScrollerUtil::scrollableAreaFor(*target); |
76 | 76 |
77 if (!targetScroller) | 77 if (!targetScroller) |
78 return; | 78 return; |
79 | 79 |
80 if (m_globalRootScroller) | 80 if (m_globalRootScroller) |
81 m_globalRootScroller->removeApplyScroll(); | 81 m_globalRootScroller->removeApplyScroll(); |
82 | 82 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 // the root scroller gets composited. | 177 // the root scroller gets composited. |
178 | 178 |
179 return graphicsLayer; | 179 return graphicsLayer; |
180 } | 180 } |
181 | 181 |
182 Element* TopDocumentRootScrollerController::globalRootScroller() const { | 182 Element* TopDocumentRootScrollerController::globalRootScroller() const { |
183 return m_globalRootScroller.get(); | 183 return m_globalRootScroller.get(); |
184 } | 184 } |
185 | 185 |
186 } // namespace blink | 186 } // namespace blink |
OLD | NEW |