Bug 1644567 - Use a more appropriate check when reading the visual viewport offset. r=botond

Instead of checking for the visual viewport *size* being set, we check for
the *offset* being set. This makes more sense becuase we're going to be
reading the offset, not the size.

Depends on D81740

Differential Revision: https://phabricator.services.mozilla.com/D81741
This commit is contained in:
Kartikaya Gupta 2020-07-03 15:55:56 +00:00
Родитель c9225cd3ec
Коммит 77b4f9fdf9
1 изменённых файлов: 4 добавлений и 2 удалений

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

@ -4283,11 +4283,13 @@ nsSize ScrollFrameHelper::GetVisualViewportSize() const {
nsPoint ScrollFrameHelper::GetVisualViewportOffset() const {
PresShell* presShell = mOuter->PresShell();
if (mIsRoot && presShell->IsVisualViewportSizeSet()) {
if (mIsRoot) {
if (auto pendingUpdate = presShell->GetPendingVisualScrollUpdate()) {
return pendingUpdate->mVisualScrollOffset;
}
return presShell->GetVisualViewportOffset();
if (presShell->IsVisualViewportOffsetSet()) {
return presShell->GetVisualViewportOffset();
}
}
return GetScrollPosition();
}