зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1753881. If the visual viewport offset hasn't been set on the presshell return the layout scroll position. r=botond
Because that is the correct value. Differential Revision: https://phabricator.services.mozilla.com/D139472
This commit is contained in:
Родитель
9cd34079f8
Коммит
ed30449176
|
@ -11197,7 +11197,14 @@ bool PresShell::SetVisualViewportOffset(const nsPoint& aScrollOffset,
|
|||
}
|
||||
}
|
||||
|
||||
nsPoint prevOffset = GetVisualViewportOffset();
|
||||
// Careful here not to call GetVisualViewportOffset to get the previous visual
|
||||
// viewport offset because if mVisualViewportOffset is nothing then we'll get
|
||||
// the layout scroll position directly from the scroll frame and it has likely
|
||||
// already been updated.
|
||||
nsPoint prevOffset = aPrevLayoutScrollPos;
|
||||
if (mVisualViewportOffset.isSome()) {
|
||||
prevOffset = *mVisualViewportOffset;
|
||||
}
|
||||
if (prevOffset == newOffset) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -1481,7 +1481,10 @@ class PresShell final : public nsStubDocumentObserver,
|
|||
const nsPoint& aPrevLayoutScrollPos);
|
||||
|
||||
nsPoint GetVisualViewportOffset() const {
|
||||
return mVisualViewportOffset.valueOr(nsPoint());
|
||||
if (mVisualViewportOffset.isSome()) {
|
||||
return *mVisualViewportOffset;
|
||||
}
|
||||
return GetLayoutViewportOffset();
|
||||
}
|
||||
bool IsVisualViewportOffsetSet() const {
|
||||
return mVisualViewportOffset.isSome();
|
||||
|
|
Загрузка…
Ссылка в новой задаче