Bug 1661897 - Acknowledge pending visual scroll updates for any RSF. r=botond

We set pending visual scroll updates even for RSFs that are on subdocuments,
so we should ensure they get acknowledged and cleared on paints. Otherwise
the pending visual scroll update can get "stuck" and it affects things that
depend on it, such as the drag-selection code.

Differential Revision: https://phabricator.services.mozilla.com/D88893
This commit is contained in:
Kartikaya Gupta 2020-08-31 20:34:34 +00:00
parent 70acdd65af
commit 447dd12c94

View File

@ -9296,7 +9296,9 @@ ScrollMetadata nsLayoutUtils::ComputeScrollMetadata(
presShell->ScrollToVisual(presShell->GetVisualViewportOffset(),
FrameMetrics::eRestore, ScrollMode::Instant);
}
}
if (scrollableFrame->IsRootScrollFrameOfDocument()) {
if (const Maybe<PresShell::VisualScrollUpdate>& visualUpdate =
presShell->GetPendingVisualScrollUpdate()) {
metrics.SetVisualDestination(
@ -9304,6 +9306,9 @@ ScrollMetadata nsLayoutUtils::ComputeScrollMetadata(
metrics.SetVisualScrollUpdateType(visualUpdate->mUpdateType);
presShell->AcknowledgePendingVisualScrollUpdate();
}
}
if (aIsRootContent) {
// Expand the layout viewport to the size including the area covered by
// the dynamic toolbar in the case where the dynamic toolbar is being
// used, otherwise when the dynamic toolbar transitions on the compositor,