| 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 1983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1994 | 1994 |
| 1995 initializeWithDesktopSettings(); | 1995 initializeWithDesktopSettings(); |
| 1996 webViewImpl()->resize(IntSize(800, 600)); | 1996 webViewImpl()->resize(IntSize(800, 600)); |
| 1997 | 1997 |
| 1998 registerMockedHttpURLLoad("icb-relative-content.html"); | 1998 registerMockedHttpURLLoad("icb-relative-content.html"); |
| 1999 navigateTo(m_baseURL + "icb-relative-content.html"); | 1999 navigateTo(m_baseURL + "icb-relative-content.html"); |
| 2000 | 2000 |
| 2001 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView(); | 2001 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView(); |
| 2002 frameView.layoutViewportScrollableArea()->setScrollOffset( | 2002 frameView.layoutViewportScrollableArea()->setScrollOffset( |
| 2003 ScrollOffset(700, 500), ProgrammaticScroll); | 2003 ScrollOffset(700, 500), ProgrammaticScroll); |
| 2004 webViewImpl()->updateAllLifecyclePhases(); |
| 2004 | 2005 |
| 2005 webViewImpl()->resize(IntSize(800, 300)); | 2006 webViewImpl()->resize(IntSize(800, 300)); |
| 2006 EXPECT_SIZE_EQ(ScrollOffset(700, 200), | 2007 EXPECT_SIZE_EQ(ScrollOffset(700, 200), |
| 2007 frameView.layoutViewportScrollableArea()->scrollOffset()); | 2008 frameView.layoutViewportScrollableArea()->scrollOffset()); |
| 2008 | 2009 |
| 2009 RuntimeEnabledFeatures::setScrollAnchoringEnabled(wasScrollAnchoringEnabled); | 2010 RuntimeEnabledFeatures::setScrollAnchoringEnabled(wasScrollAnchoringEnabled); |
| 2010 } | 2011 } |
| 2011 | 2012 |
| 2012 // Ensure that resize anchoring as happens when top controls hide/show affects | 2013 // Ensure that resize anchoring as happens when top controls hide/show affects |
| 2013 // the scrollable area that's currently set as the root scroller. | 2014 // the scrollable area that's currently set as the root scroller. |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2069 webViewImpl()->resize(IntSize(600, 800)); | 2070 webViewImpl()->resize(IntSize(600, 800)); |
| 2070 | 2071 |
| 2071 EXPECT_SIZE_EQ(ScrollOffset(), | 2072 EXPECT_SIZE_EQ(ScrollOffset(), |
| 2072 frameView.layoutViewportScrollableArea()->scrollOffset()); | 2073 frameView.layoutViewportScrollableArea()->scrollOffset()); |
| 2073 EXPECT_EQ(600, scroller->scrollTop()); | 2074 EXPECT_EQ(600, scroller->scrollTop()); |
| 2074 | 2075 |
| 2075 RuntimeEnabledFeatures::setSetRootScrollerEnabled(wasRootScrollerEnabled); | 2076 RuntimeEnabledFeatures::setSetRootScrollerEnabled(wasRootScrollerEnabled); |
| 2076 } | 2077 } |
| 2077 | 2078 |
| 2078 } // namespace | 2079 } // namespace |
| OLD | NEW |