| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/frame/VisualViewport.h" | 5 #include "core/frame/VisualViewport.h" |
| 6 | 6 |
| 7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/frame/FrameHost.h" | 8 #include "core/frame/FrameHost.h" |
| 9 #include "core/frame/FrameView.h" | 9 #include "core/frame/FrameView.h" |
| 10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
| (...skipping 1979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1990 | 1990 |
| 1991 initializeWithDesktopSettings(); | 1991 initializeWithDesktopSettings(); |
| 1992 webViewImpl()->resize(IntSize(800, 600)); | 1992 webViewImpl()->resize(IntSize(800, 600)); |
| 1993 | 1993 |
| 1994 registerMockedHttpURLLoad("icb-relative-content.html"); | 1994 registerMockedHttpURLLoad("icb-relative-content.html"); |
| 1995 navigateTo(m_baseURL + "icb-relative-content.html"); | 1995 navigateTo(m_baseURL + "icb-relative-content.html"); |
| 1996 | 1996 |
| 1997 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView(); | 1997 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView(); |
| 1998 frameView.layoutViewportScrollableArea()->setScrollOffset( | 1998 frameView.layoutViewportScrollableArea()->setScrollOffset( |
| 1999 ScrollOffset(700, 500), ProgrammaticScroll); | 1999 ScrollOffset(700, 500), ProgrammaticScroll); |
| 2000 webViewImpl()->updateAllLifecyclePhases(); |
| 2000 | 2001 |
| 2001 webViewImpl()->resize(IntSize(800, 300)); | 2002 webViewImpl()->resize(IntSize(800, 300)); |
| 2002 EXPECT_SIZE_EQ(ScrollOffset(700, 200), | 2003 EXPECT_SIZE_EQ(ScrollOffset(700, 200), |
| 2003 frameView.layoutViewportScrollableArea()->scrollOffset()); | 2004 frameView.layoutViewportScrollableArea()->scrollOffset()); |
| 2004 | 2005 |
| 2005 RuntimeEnabledFeatures::setScrollAnchoringEnabled(wasScrollAnchoringEnabled); | 2006 RuntimeEnabledFeatures::setScrollAnchoringEnabled(wasScrollAnchoringEnabled); |
| 2006 } | 2007 } |
| 2007 | 2008 |
| 2008 // Ensure that resize anchoring as happens when top controls hide/show affects | 2009 // Ensure that resize anchoring as happens when top controls hide/show affects |
| 2009 // the scrollable area that's currently set as the root scroller. | 2010 // the scrollable area that's currently set as the root scroller. |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2065 webViewImpl()->resize(IntSize(600, 800)); | 2066 webViewImpl()->resize(IntSize(600, 800)); |
| 2066 | 2067 |
| 2067 EXPECT_SIZE_EQ(ScrollOffset(), | 2068 EXPECT_SIZE_EQ(ScrollOffset(), |
| 2068 frameView.layoutViewportScrollableArea()->scrollOffset()); | 2069 frameView.layoutViewportScrollableArea()->scrollOffset()); |
| 2069 EXPECT_EQ(600, scroller->scrollTop()); | 2070 EXPECT_EQ(600, scroller->scrollTop()); |
| 2070 | 2071 |
| 2071 RuntimeEnabledFeatures::setSetRootScrollerEnabled(wasRootScrollerEnabled); | 2072 RuntimeEnabledFeatures::setSetRootScrollerEnabled(wasRootScrollerEnabled); |
| 2072 } | 2073 } |
| 2073 | 2074 |
| 2074 } // namespace | 2075 } // namespace |
| OLD | NEW |