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

Unified Diff: Source/core/input/EventHandler.cpp

Issue 1214673006: Reset unusedDelta on Onverscroll for residual values. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: addressed review comments Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/web/tests/WebFrameTest.cpp » ('j') | Source/web/tests/WebFrameTest.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/input/EventHandler.cpp
diff --git a/Source/core/input/EventHandler.cpp b/Source/core/input/EventHandler.cpp
index d16e9e2e4ef679e408209463115845eef5fa68ce..fe3dfd0b764b2ec85df1782e141a7895f1dc396b 100644
--- a/Source/core/input/EventHandler.cpp
+++ b/Source/core/input/EventHandler.cpp
@@ -97,6 +97,20 @@
namespace blink {
+// Report Overscroll if OverscrollDelta is greater than minimumOverscrollDelta
+// to maintain consistency as did in compositor.
+static const float minimumOverscrollDelta = 0.1;
majidvp 2015/07/09 18:01:18 Please move this next to other constants.
MuVen 2015/07/09 18:10:06 Done.
+
+static inline FloatSize adjustOverscoll(FloatSize unusedDelta)
majidvp 2015/07/09 18:01:18 Given that there is a single member func that uses
MuVen 2015/07/09 18:10:06 Done.
+{
+ if (std::abs(unusedDelta.width()) < minimumOverscrollDelta)
+ unusedDelta.setWidth(0);
+ if (std::abs(unusedDelta.height()) < minimumOverscrollDelta)
+ unusedDelta.setHeight(0);
+
+ return unusedDelta;
+}
+
using namespace HTMLNames;
// The link drag hysteresis is much larger than the others because there
@@ -2244,6 +2258,7 @@ void EventHandler::resetOverscroll(bool didScrollX, bool didScrollY)
void EventHandler::handleOverscroll(const ScrollResult& scrollResult, const FloatPoint& position, const FloatSize& velocity)
{
FloatSize unusedDelta(scrollResult.unusedScrollDeltaX, scrollResult.unusedScrollDeltaY);
+ unusedDelta = adjustOverscoll(unusedDelta);
resetOverscroll(scrollResult.didScrollX, scrollResult.didScrollY);
if (unusedDelta != FloatSize()) {
m_accumulatedRootOverscroll += unusedDelta;
« no previous file with comments | « no previous file | Source/web/tests/WebFrameTest.cpp » ('j') | Source/web/tests/WebFrameTest.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698