Bug 1642869. Check if the visual viewport differs from the layout viewport in ScrollFrameHelper::GetPageScrollAmount. r=kats

So we can preserve the scrolling behaviour that takes into account fixed "headers" and "footers".

Differential Revision: https://phabricator.services.mozilla.com/D77985
This commit is contained in:
Timothy Nikkel 2020-06-04 02:01:06 +00:00
Родитель e9698866a7
Коммит 3d8f182b50
1 изменённых файлов: 2 добавлений и 3 удалений

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

@ -4569,13 +4569,12 @@ static nsSize GetScrollPortSizeExcludingHeadersAndFooters(
nsSize ScrollFrameHelper::GetPageScrollAmount() const {
nsSize effectiveScrollPortSize;
PresShell* presShell = mOuter->PresShell();
if (mIsRoot && presShell->IsVisualViewportSizeSet()) {
if (GetVisualViewportSize() != mScrollPort.Size()) {
// We want to use the visual viewport size if one is set.
// The headers/footers adjustment is too complicated to do if there is a
// visual viewport that differs from the layout viewport, this is probably
// okay.
effectiveScrollPortSize = presShell->GetVisualViewportSize();
effectiveScrollPortSize = GetVisualViewportSize();
} else {
// Reduce effective scrollport height by the height of any
// fixed-pos/sticky-pos headers or footers