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

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

Issue 2124973004: ScrollableArea should update scrollAnimator with clamped position. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use clamped but non-truncated position during ScrollableArea update. Created 4 years, 5 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 | « no previous file | 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 /* 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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 if (Scrollbar* horizontalScrollbar = this->horizontalScrollbar()) 275 if (Scrollbar* horizontalScrollbar = this->horizontalScrollbar())
276 horizontalScrollbar->offsetDidChange(); 276 horizontalScrollbar->offsetDidChange();
277 if (Scrollbar* verticalScrollbar = this->verticalScrollbar()) 277 if (Scrollbar* verticalScrollbar = this->verticalScrollbar())
278 verticalScrollbar->offsetDidChange(); 278 verticalScrollbar->offsetDidChange();
279 279
280 if (scrollPositionDouble() != oldPosition) { 280 if (scrollPositionDouble() != oldPosition) {
281 // FIXME: Pass in DoubleSize. crbug.com/414283. 281 // FIXME: Pass in DoubleSize. crbug.com/414283.
282 scrollAnimator().notifyContentAreaScrolled(toFloatSize(scrollPositionDou ble() - oldPosition)); 282 scrollAnimator().notifyContentAreaScrolled(toFloatSize(scrollPositionDou ble() - oldPosition));
283 } 283 }
284 284
285 scrollAnimator().setCurrentPosition(toFloatPoint(position)); 285 scrollAnimator().setCurrentPosition(toFloatPoint(clampScrollPosition(positio n)));
286 } 286 }
287 287
288 bool ScrollableArea::scrollBehaviorFromString(const String& behaviorString, Scro llBehavior& behavior) 288 bool ScrollableArea::scrollBehaviorFromString(const String& behaviorString, Scro llBehavior& behavior)
289 { 289 {
290 if (behaviorString == "auto") 290 if (behaviorString == "auto")
291 behavior = ScrollBehaviorAuto; 291 behavior = ScrollBehaviorAuto;
292 else if (behaviorString == "instant") 292 else if (behaviorString == "instant")
293 behavior = ScrollBehaviorInstant; 293 behavior = ScrollBehaviorInstant;
294 else if (behaviorString == "smooth") 294 else if (behaviorString == "smooth")
295 behavior = ScrollBehaviorSmooth; 295 behavior = ScrollBehaviorSmooth;
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 std::max(0, size.height() - horizontalScrollbarHeight())); 611 std::max(0, size.height() - horizontalScrollbarHeight()));
612 } 612 }
613 613
614 DEFINE_TRACE(ScrollableArea) 614 DEFINE_TRACE(ScrollableArea)
615 { 615 {
616 visitor->trace(m_scrollAnimator); 616 visitor->trace(m_scrollAnimator);
617 visitor->trace(m_programmaticScrollAnimator); 617 visitor->trace(m_programmaticScrollAnimator);
618 } 618 }
619 619
620 } // namespace blink 620 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698