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 ...@@ -233,8 +233,6 @@ bool AutoscrollController::panScrollInProgress() const
} }
#endif #endif
// FIXME: This would get get better animation fidelity if it used the monotonicFrameBeginTime instead
// of WTF::currentTime().
void AutoscrollController::animate(double) void AutoscrollController::animate(double)
{ {
if (!m_autoscrollLayoutObject) { if (!m_autoscrollLayoutObject) {
...@@ -244,7 +242,7 @@ void AutoscrollController::animate(double) ...@@ -244,7 +242,7 @@ void AutoscrollController::animate(double)
switch (m_autoscrollType) { switch (m_autoscrollType) {
case AutoscrollForDragAndDrop: case AutoscrollForDragAndDrop:
if (WTF::currentTime() - m_dragAndDropAutoscrollStartTime > autoscrollDelay) if (WTF::monotonicallyIncreasingTime() - m_dragAndDropAutoscrollStartTime > autoscrollDelay)
m_autoscrollLayoutObject->autoscroll(m_dragAndDropAutoscrollReferencePosition); m_autoscrollLayoutObject->autoscroll(m_dragAndDropAutoscrollReferencePosition);
break; break;
case AutoscrollForSelection: 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