Bug 1519285 - Populate the (main thread's view of the) visual scroll offset in ComputeScrollMetadata(). r=kats

Differential Revision: https://phabricator.services.mozilla.com/D87160
This commit is contained in:
Botond Ballo 2020-08-18 04:13:01 +00:00
Родитель a4ecb96c87
Коммит aa190d473c
1 изменённых файлов: 8 добавлений и 6 удалений

Просмотреть файл

@ -9272,16 +9272,18 @@ ScrollMetadata nsLayoutUtils::ComputeScrollMetadata(
scrollableFrame, aForFrame)));
if (scrollableFrame) {
CSSPoint scrollPosition =
CSSPoint layoutScrollOffset =
CSSPoint::FromAppUnits(scrollableFrame->GetScrollPosition());
CSSPoint apzScrollPosition =
CSSPoint::FromAppUnits(scrollableFrame->GetApzScrollPosition());
metrics.SetVisualScrollOffset(scrollPosition);
metrics.SetBaseScrollOffset(apzScrollPosition);
metrics.SetVisualViewportOffset(
CSSPoint visualScrollOffset =
aIsRootContent && presShell->IsVisualViewportOffsetSet()
? CSSPoint::FromAppUnits(presShell->GetVisualViewportOffset())
: scrollPosition);
: layoutScrollOffset;
metrics.SetVisualScrollOffset(visualScrollOffset);
metrics.SetBaseScrollOffset(apzScrollPosition);
// FIXME: This is redundant now.
metrics.SetVisualViewportOffset(visualScrollOffset);
if (aIsRootContent) {
if (aLayerManager->GetIsFirstPaint() &&
@ -9336,7 +9338,7 @@ ScrollMetadata nsLayoutUtils::ComputeScrollMetadata(
}
CSSRect viewport = metrics.GetLayoutViewport();
viewport.MoveTo(scrollPosition);
viewport.MoveTo(layoutScrollOffset);
metrics.SetLayoutViewport(viewport);
nsPoint smoothScrollPosition = scrollableFrame->LastScrollDestination();