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

Side by Side Diff: Source/core/frame/RootFrameViewportTest.cpp

Issue 1173053003: Remove ScrollableArea::notifyScrollPositionChanged and cleanup scroll animators. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase + remove updateScrollbars from FrameView::setScrollPosition Created 5 years, 6 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 | « Source/core/frame/FrameView.cpp ('k') | Source/core/loader/FrameLoader.cpp » ('j') | 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 "config.h" 5 #include "config.h"
6 6
7 #include "core/frame/RootFrameViewport.h" 7 #include "core/frame/RootFrameViewport.h"
8 8
9 #include "core/layout/ScrollAlignment.h" 9 #include "core/layout/ScrollAlignment.h"
10 #include "platform/geometry/DoubleRect.h" 10 #include "platform/geometry/DoubleRect.h"
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 ScrollAlignment::alignToEdgeIfNeeded, 378 ScrollAlignment::alignToEdgeIfNeeded,
379 ScrollAlignment::alignToEdgeIfNeeded); 379 ScrollAlignment::alignToEdgeIfNeeded);
380 EXPECT_POINT_EQ(DoublePoint(100, 150), layoutViewport.scrollPositionDouble() ); 380 EXPECT_POINT_EQ(DoublePoint(100, 150), layoutViewport.scrollPositionDouble() );
381 EXPECT_POINT_EQ(DoublePoint(50, 75), visualViewport.scrollPositionDouble()); 381 EXPECT_POINT_EQ(DoublePoint(50, 75), visualViewport.scrollPositionDouble());
382 382
383 // Scrolling into view the viewport rect itself should be a no-op. 383 // Scrolling into view the viewport rect itself should be a no-op.
384 visualViewport.setViewportSize(IntSize(100, 100)); 384 visualViewport.setViewportSize(IntSize(100, 100));
385 visualViewport.setScale(1.5f); 385 visualViewport.setScale(1.5f);
386 visualViewport.setScrollPosition(DoublePoint(0, 10), ProgrammaticScroll); 386 visualViewport.setScrollPosition(DoublePoint(0, 10), ProgrammaticScroll);
387 layoutViewport.setScrollPosition(DoublePoint(50, 50), ProgrammaticScroll); 387 layoutViewport.setScrollPosition(DoublePoint(50, 50), ProgrammaticScroll);
388 rootFrameViewport->notifyScrollPositionChanged(rootFrameViewport->scrollPosi tionDouble()); 388 rootFrameViewport->setScrollPosition(rootFrameViewport->scrollPositionDouble (), ProgrammaticScroll);
389 389
390 rootFrameViewport->scrollIntoView( 390 rootFrameViewport->scrollIntoView(
391 LayoutRect(rootFrameViewport->visibleContentRectDouble(ExcludeScrollbars )), 391 LayoutRect(rootFrameViewport->visibleContentRectDouble(ExcludeScrollbars )),
392 ScrollAlignment::alignToEdgeIfNeeded, 392 ScrollAlignment::alignToEdgeIfNeeded,
393 ScrollAlignment::alignToEdgeIfNeeded); 393 ScrollAlignment::alignToEdgeIfNeeded);
394 EXPECT_POINT_EQ(DoublePoint(50, 50), layoutViewport.scrollPositionDouble()); 394 EXPECT_POINT_EQ(DoublePoint(50, 50), layoutViewport.scrollPositionDouble());
395 EXPECT_POINT_EQ(DoublePoint(0, 10), visualViewport.scrollPositionDouble()); 395 EXPECT_POINT_EQ(DoublePoint(0, 10), visualViewport.scrollPositionDouble());
396 396
397 rootFrameViewport->scrollIntoView( 397 rootFrameViewport->scrollIntoView(
398 LayoutRect(rootFrameViewport->visibleContentRectDouble(ExcludeScrollbars )), 398 LayoutRect(rootFrameViewport->visibleContentRectDouble(ExcludeScrollbars )),
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 ScrollResult result = rootFrameViewport->handleWheel(wheelEvent); 493 ScrollResult result = rootFrameViewport->handleWheel(wheelEvent);
494 494
495 EXPECT_TRUE(result.didScroll()); 495 EXPECT_TRUE(result.didScroll());
496 EXPECT_POINT_EQ(DoublePoint(50, 50), visualViewport.scrollPositionDouble()); 496 EXPECT_POINT_EQ(DoublePoint(50, 50), visualViewport.scrollPositionDouble());
497 EXPECT_POINT_EQ(DoublePoint(100, 200), layoutViewport.scrollPositionDouble() ); 497 EXPECT_POINT_EQ(DoublePoint(100, 200), layoutViewport.scrollPositionDouble() );
498 EXPECT_EQ(-350, result.unusedScrollDeltaX); 498 EXPECT_EQ(-350, result.unusedScrollDeltaX);
499 EXPECT_EQ(-250, result.unusedScrollDeltaY); 499 EXPECT_EQ(-250, result.unusedScrollDeltaY);
500 } 500 }
501 501
502 } // namespace blink 502 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/FrameView.cpp ('k') | Source/core/loader/FrameLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698