зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
a4ecb96c87
Коммит
aa190d473c
|
@ -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();
|
||||
|
|
Загрузка…
Ссылка в новой задаче