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

Side by Side Diff: Source/platform/scroll/ScrollableArea.cpp

Issue 879163002: Hook up window.scrollTo and friends. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@sa
Patch Set: rebase Created 5 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2010, Google Inc. All rights reserved. 2 * Copyright (c) 2010, Google Inc. All rights reserved.
3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. 3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 step = pixelStep(orientation); 152 step = pixelStep(orientation);
153 break; 153 break;
154 } 154 }
155 155
156 if (direction == ScrollUp || direction == ScrollLeft) 156 if (direction == ScrollUp || direction == ScrollLeft)
157 delta = -delta; 157 delta = -delta;
158 158
159 return scrollAnimator()->scroll(orientation, granularity, step, delta); 159 return scrollAnimator()->scroll(orientation, granularity, step, delta);
160 } 160 }
161 161
162 void ScrollableArea::setScrollPosition(const DoublePoint& position, ScrollBehavi or behavior)
163 {
164 // FIXME(417782): This should be unified with RenderLayerScrollableArea::scr ollToOffset.
165 ASSERT_NOT_REACHED();
166 }
167
162 void ScrollableArea::scrollToOffsetWithoutAnimation(const FloatPoint& offset, bo ol cancelProgrammaticAnimations) 168 void ScrollableArea::scrollToOffsetWithoutAnimation(const FloatPoint& offset, bo ol cancelProgrammaticAnimations)
163 { 169 {
164 if (cancelProgrammaticAnimations) 170 if (cancelProgrammaticAnimations)
165 cancelProgrammaticScrollAnimation(); 171 cancelProgrammaticScrollAnimation();
166 scrollAnimator()->scrollToOffsetWithoutAnimation(offset); 172 scrollAnimator()->scrollToOffsetWithoutAnimation(offset);
167 } 173 }
168 174
169 void ScrollableArea::scrollToOffsetWithoutAnimation(ScrollbarOrientation orienta tion, float offset) 175 void ScrollableArea::scrollToOffsetWithoutAnimation(ScrollbarOrientation orienta tion, float offset)
170 { 176 {
171 if (orientation == HorizontalScrollbar) 177 if (orientation == HorizontalScrollbar)
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 { 517 {
512 return scrollSize(orientation); 518 return scrollSize(orientation);
513 } 519 }
514 520
515 float ScrollableArea::pixelStep(ScrollbarOrientation) const 521 float ScrollableArea::pixelStep(ScrollbarOrientation) const
516 { 522 {
517 return 1; 523 return 1;
518 } 524 }
519 525
520 } // namespace blink 526 } // namespace blink
OLDNEW
« Source/core/frame/PinchViewport.cpp ('K') | « Source/platform/scroll/ScrollableArea.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698