Commit 7d69521b authored by sunyunjia's avatar sunyunjia Committed by Commit bot

Use monotonic time instead of current time in autoscroll controller

Use of a wall clock to drive an animation is dangerous. We should be using the monotinic time.

BUG=645098

Review-Url: https://codereview.chromium.org/2326643002
Cr-Commit-Position: refs/heads/master@{#417365}
parent f93ad8eb
......@@ -233,8 +233,6 @@ bool AutoscrollController::panScrollInProgress() const
}
#endif
// FIXME: This would get get better animation fidelity if it used the monotonicFrameBeginTime instead
// of WTF::currentTime().
void AutoscrollController::animate(double)
{
if (!m_autoscrollLayoutObject) {
......@@ -244,7 +242,7 @@ void AutoscrollController::animate(double)
switch (m_autoscrollType) {
case AutoscrollForDragAndDrop:
if (WTF::currentTime() - m_dragAndDropAutoscrollStartTime > autoscrollDelay)
if (WTF::monotonicallyIncreasingTime() - m_dragAndDropAutoscrollStartTime > autoscrollDelay)
m_autoscrollLayoutObject->autoscroll(m_dragAndDropAutoscrollReferencePosition);
break;
case AutoscrollForSelection:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment