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

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

Issue 2212543002: Disable scroll anchoring if the user engages in a drag motion (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove irrelevant comment Created 4 years, 4 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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 void ScrollableArea::scrollPositionChanged(const DoublePoint& position, ScrollTy pe scrollType) 263 void ScrollableArea::scrollPositionChanged(const DoublePoint& position, ScrollTy pe scrollType)
264 { 264 {
265 TRACE_EVENT0("blink", "ScrollableArea::scrollPositionChanged"); 265 TRACE_EVENT0("blink", "ScrollableArea::scrollPositionChanged");
266 266
267 DoublePoint oldPosition = scrollPositionDouble(); 267 DoublePoint oldPosition = scrollPositionDouble();
268 DoublePoint truncatedPosition = shouldUseIntegerScrollOffset() ? flooredIntP oint(position) : position; 268 DoublePoint truncatedPosition = shouldUseIntegerScrollOffset() ? flooredIntP oint(position) : position;
269 269
270 // Tell the derived class to scroll its contents. 270 // Tell the derived class to scroll its contents.
271 setScrollOffset(truncatedPosition, scrollType); 271 setScrollOffset(truncatedPosition, scrollType);
272 272
273 // If the scroll position is changed, the user is not dragging (e.g panning
274 // a map).
275 setUserMayHaveDragged(false);
276
273 // Tell the scrollbars to update their thumb postions. 277 // Tell the scrollbars to update their thumb postions.
274 // If the scrollbar does not have its own layer, it must always be 278 // If the scrollbar does not have its own layer, it must always be
275 // invalidated to reflect the new thumb position, even if the theme did not 279 // invalidated to reflect the new thumb position, even if the theme did not
276 // invalidate any individual part. 280 // invalidate any individual part.
277 if (Scrollbar* horizontalScrollbar = this->horizontalScrollbar()) 281 if (Scrollbar* horizontalScrollbar = this->horizontalScrollbar())
278 horizontalScrollbar->offsetDidChange(); 282 horizontalScrollbar->offsetDidChange();
279 if (Scrollbar* verticalScrollbar = this->verticalScrollbar()) 283 if (Scrollbar* verticalScrollbar = this->verticalScrollbar())
280 verticalScrollbar->offsetDidChange(); 284 verticalScrollbar->offsetDidChange();
281 285
282 if (scrollPositionDouble() != oldPosition) { 286 if (scrollPositionDouble() != oldPosition) {
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 std::max(0, size.height() - horizontalScrollbarHeight())); 617 std::max(0, size.height() - horizontalScrollbarHeight()));
614 } 618 }
615 619
616 DEFINE_TRACE(ScrollableArea) 620 DEFINE_TRACE(ScrollableArea)
617 { 621 {
618 visitor->trace(m_scrollAnimator); 622 visitor->trace(m_scrollAnimator);
619 visitor->trace(m_programmaticScrollAnimator); 623 visitor->trace(m_programmaticScrollAnimator);
620 } 624 }
621 625
622 } // namespace blink 626 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698