зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
c9225cd3ec
Коммит
77b4f9fdf9
|
@ -4283,11 +4283,13 @@ nsSize ScrollFrameHelper::GetVisualViewportSize() const {
|
||||||
|
|
||||||
nsPoint ScrollFrameHelper::GetVisualViewportOffset() const {
|
nsPoint ScrollFrameHelper::GetVisualViewportOffset() const {
|
||||||
PresShell* presShell = mOuter->PresShell();
|
PresShell* presShell = mOuter->PresShell();
|
||||||
if (mIsRoot && presShell->IsVisualViewportSizeSet()) {
|
if (mIsRoot) {
|
||||||
if (auto pendingUpdate = presShell->GetPendingVisualScrollUpdate()) {
|
if (auto pendingUpdate = presShell->GetPendingVisualScrollUpdate()) {
|
||||||
return pendingUpdate->mVisualScrollOffset;
|
return pendingUpdate->mVisualScrollOffset;
|
||||||
}
|
}
|
||||||
return presShell->GetVisualViewportOffset();
|
if (presShell->IsVisualViewportOffsetSet()) {
|
||||||
|
return presShell->GetVisualViewportOffset();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return GetScrollPosition();
|
return GetScrollPosition();
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче