Bug 1531535 - Add visual smooth scroll support to nsIPresShell. r=kats

This patch renames nsIPresShell::SetPendingVisualScrollUpdate() to
ScrollToVisual(), and adds an instant vs. smooth option.

SetPendingVisualScrollUpdate() still exists, as a helper for the instant case.

Differential Revision: https://phabricator.services.mozilla.com/D24553
This commit is contained in:
Botond Ballo
2019-03-23 20:23:35 +00:00
parent 0181fa8b5c
commit a76969f2b8
10 changed files with 90 additions and 16 deletions

View File

@@ -5660,8 +5660,8 @@ nsresult nsDocShell::SetCurScrollPosEx(int32_t aCurHorizontalPos,
// TODO: If scrollMode == SMOOTH_MSD, this will effectively override that
// and jump to the target position instantly. A proper solution here would
// involve giving nsIScrollableFrame a visual viewport smooth scrolling API.
shell->SetPendingVisualScrollUpdate(targetPos,
layers::FrameMetrics::eMainThread);
shell->ScrollToVisual(targetPos, layers::FrameMetrics::eMainThread,
nsIPresShell::ScrollMode::eInstant);
return NS_OK;
}