| 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 #ifndef ResizeViewportAnchor_h | 5 #ifndef ResizeViewportAnchor_h |
| 6 #define ResizeViewportAnchor_h | 6 #define ResizeViewportAnchor_h |
| 7 | 7 |
| 8 #include "core/page/Page.h" | 8 #include "core/page/Page.h" |
| 9 #include "platform/geometry/DoubleSize.h" | |
| 10 #include "platform/heap/Handle.h" | 9 #include "platform/heap/Handle.h" |
| 10 #include "platform/scroll/ScrollTypes.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 class FrameView; | 14 class FrameView; |
| 15 | 15 |
| 16 // This class scrolls the viewports to compensate for bounds clamping caused by | 16 // This class scrolls the viewports to compensate for bounds clamping caused by |
| 17 // viewport size changes. | 17 // viewport size changes. |
| 18 // | 18 // |
| 19 // It is needed when the layout viewport grows (causing its own scroll position | 19 // It is needed when the layout viewport grows (causing its own scroll position |
| 20 // to be clamped) and also when it shrinks (causing the visual viewport's scroll | 20 // to be clamped) and also when it shrinks (causing the visual viewport's scroll |
| (...skipping 23 matching lines...) Expand all Loading... |
| 44 DEFINE_INLINE_TRACE() { visitor->trace(m_page); } | 44 DEFINE_INLINE_TRACE() { visitor->trace(m_page); } |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 void beginScope() { m_scopeCount++; } | 47 void beginScope() { m_scopeCount++; } |
| 48 void endScope(); | 48 void endScope(); |
| 49 FrameView* rootFrameView(); | 49 FrameView* rootFrameView(); |
| 50 | 50 |
| 51 // The amount of resize-induced clamping drift accumulated during the | 51 // The amount of resize-induced clamping drift accumulated during the |
| 52 // ResizeScope. Note that this should NOT include other kinds of scrolling | 52 // ResizeScope. Note that this should NOT include other kinds of scrolling |
| 53 // that may occur during layout, such as from ScrollAnchor. | 53 // that may occur during layout, such as from ScrollAnchor. |
| 54 DoubleSize m_drift; | 54 ScrollOffset m_drift; |
| 55 Member<Page> m_page; | 55 Member<Page> m_page; |
| 56 int m_scopeCount; | 56 int m_scopeCount; |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 } // namespace blink | 59 } // namespace blink |
| 60 | 60 |
| 61 #endif // ResizeViewportAnchor_h | 61 #endif // ResizeViewportAnchor_h |
| OLD | NEW |