Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(276)

Side by Side Diff: third_party/WebKit/Source/web/tests/VisualViewportTest.cpp

Issue 2360833002: Only anchor along the block layout axis. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1830 matching lines...) Expand 10 before | Expand all | Expand 10 after
1841 1841
1842 initializeWithDesktopSettings(); 1842 initializeWithDesktopSettings();
1843 webViewImpl()->resize(IntSize(800, 600)); 1843 webViewImpl()->resize(IntSize(800, 600));
1844 1844
1845 registerMockedHttpURLLoad("icb-relative-content.html"); 1845 registerMockedHttpURLLoad("icb-relative-content.html");
1846 navigateTo(m_baseURL + "icb-relative-content.html"); 1846 navigateTo(m_baseURL + "icb-relative-content.html");
1847 1847
1848 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView(); 1848 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView();
1849 frameView.layoutViewportScrollableArea()->setScrollPosition(DoublePoint(700, 500), ProgrammaticScroll); 1849 frameView.layoutViewportScrollableArea()->setScrollPosition(DoublePoint(700, 500), ProgrammaticScroll);
1850 1850
1851 webViewImpl()->resize(IntSize(400, 300)); 1851 webViewImpl()->resize(IntSize(800, 300));
1852 EXPECT_POINT_EQ(DoublePoint(300, 200), frameView.layoutViewportScrollableAre a()->scrollPositionDouble()); 1852 EXPECT_POINT_EQ(DoublePoint(700, 200), frameView.layoutViewportScrollableAre a()->scrollPositionDouble());
1853 1853
1854 RuntimeEnabledFeatures::setScrollAnchoringEnabled(wasScrollAnchoringEnabled) ; 1854 RuntimeEnabledFeatures::setScrollAnchoringEnabled(wasScrollAnchoringEnabled) ;
1855 } 1855 }
1856 1856
1857 // Ensure that resize anchoring as happens when top controls hide/show affects 1857 // Ensure that resize anchoring as happens when top controls hide/show affects
1858 // the scrollable area that's currently set as the root scroller. 1858 // the scrollable area that's currently set as the root scroller.
1859 TEST_P(ParameterizedVisualViewportTest, ResizeAnchoringWithRootScroller) 1859 TEST_P(ParameterizedVisualViewportTest, ResizeAnchoringWithRootScroller)
1860 { 1860 {
1861 bool wasRootScrollerEnabled = 1861 bool wasRootScrollerEnabled =
1862 RuntimeEnabledFeatures::setRootScrollerEnabled(); 1862 RuntimeEnabledFeatures::setRootScrollerEnabled();
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
1918 1918
1919 EXPECT_POINT_EQ( 1919 EXPECT_POINT_EQ(
1920 DoublePoint(), 1920 DoublePoint(),
1921 frameView.layoutViewportScrollableArea()->scrollPositionDouble()); 1921 frameView.layoutViewportScrollableArea()->scrollPositionDouble());
1922 EXPECT_EQ(600, scroller->scrollTop()); 1922 EXPECT_EQ(600, scroller->scrollTop());
1923 1923
1924 RuntimeEnabledFeatures::setSetRootScrollerEnabled(wasRootScrollerEnabled); 1924 RuntimeEnabledFeatures::setSetRootScrollerEnabled(wasRootScrollerEnabled);
1925 } 1925 }
1926 1926
1927 } // namespace 1927 } // namespace
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698