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

Side by Side Diff: Source/platform/mac/ScrollElasticityController.mm

Issue 282743002: Fix page jumping back to initial position after an overflow-bounce scroll. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove whitespace from TestExpectations that was causing a rebase failure. Created 6 years, 7 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/platform/mac/ScrollElasticityController.h ('k') | 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) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 roundToDevicePixelTowardZero(elasticDeltaForTimeDelta(m _startStretch.height(), -m_origVelocity.height(), (float)timeDelta))); 350 roundToDevicePixelTowardZero(elasticDeltaForTimeDelta(m _startStretch.height(), -m_origVelocity.height(), (float)timeDelta)));
351 351
352 if (fabs(delta.x()) >= 1 || fabs(delta.y()) >= 1) { 352 if (fabs(delta.x()) >= 1 || fabs(delta.y()) >= 1) {
353 m_client->immediateScrollByWithoutContentEdgeConstraints(FloatSize(d elta.x(), delta.y()) - m_client->stretchAmount()); 353 m_client->immediateScrollByWithoutContentEdgeConstraints(FloatSize(d elta.x(), delta.y()) - m_client->stretchAmount());
354 354
355 FloatSize newStretch = m_client->stretchAmount(); 355 FloatSize newStretch = m_client->stretchAmount();
356 356
357 m_stretchScrollForce.setWidth(reboundDeltaForElasticDelta(newStretch .width())); 357 m_stretchScrollForce.setWidth(reboundDeltaForElasticDelta(newStretch .width()));
358 m_stretchScrollForce.setHeight(reboundDeltaForElasticDelta(newStretc h.height())); 358 m_stretchScrollForce.setHeight(reboundDeltaForElasticDelta(newStretc h.height()));
359 } else { 359 } else {
360 m_client->immediateScrollBy(m_origOrigin - m_client->absoluteScrollP osition()); 360 m_client->adjustScrollPositionToBoundsIfNecessary();
361 361
362 stopSnapRubberbandTimer(); 362 stopSnapRubberbandTimer();
363 m_stretchScrollForce = FloatSize(); 363 m_stretchScrollForce = FloatSize();
364 m_startTime = 0; 364 m_startTime = 0;
365 m_startStretch = FloatSize(); 365 m_startStretch = FloatSize();
366 m_origOrigin = FloatPoint(); 366 m_origOrigin = FloatPoint();
367 m_origVelocity = FloatSize(); 367 m_origVelocity = FloatSize();
368 } 368 }
369 } else { 369 } else {
370 m_startTime = [NSDate timeIntervalSinceReferenceDate]; 370 m_startTime = [NSDate timeIntervalSinceReferenceDate];
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 return m_client->shouldRubberBandInDirection(ScrollLeft); 419 return m_client->shouldRubberBandInDirection(ScrollLeft);
420 if (wheelEvent.deltaX() < 0) 420 if (wheelEvent.deltaX() < 0)
421 return m_client->shouldRubberBandInDirection(ScrollRight); 421 return m_client->shouldRubberBandInDirection(ScrollRight);
422 422
423 return true; 423 return true;
424 } 424 }
425 425
426 } // namespace WebCore 426 } // namespace WebCore
427 427
428 #endif // USE(RUBBER_BANDING) 428 #endif // USE(RUBBER_BANDING)
OLDNEW
« no previous file with comments | « Source/platform/mac/ScrollElasticityController.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698