Bug 1509575 - Make nsIPresShell::mVisualViewportOffset a Maybe so we can tell if it's ever been set. r=kats
This allows us to e.g. avoid sending a value that's (0,0) because it hasn't been set yet in a visual scroll update. Depends on D16346 Differential Revision: https://phabricator.services.mozilla.com/D16477
This commit is contained in:
@@ -10102,9 +10102,9 @@ void nsIPresShell::SetVisualViewportSize(nscoord aWidth, nscoord aHeight) {
|
||||
bool nsIPresShell::SetVisualViewportOffset(
|
||||
const nsPoint& aScrollOffset, const nsPoint& aPrevLayoutScrollPos) {
|
||||
bool didChange = false;
|
||||
if (mVisualViewportOffset != aScrollOffset) {
|
||||
nsPoint prevOffset = mVisualViewportOffset;
|
||||
mVisualViewportOffset = aScrollOffset;
|
||||
if (GetVisualViewportOffset() != aScrollOffset) {
|
||||
nsPoint prevOffset = GetVisualViewportOffset();
|
||||
mVisualViewportOffset = Some(aScrollOffset);
|
||||
didChange = true;
|
||||
|
||||
if (auto* window = nsGlobalWindowInner::Cast(mDocument->GetInnerWindow())) {
|
||||
|
||||
Reference in New Issue
Block a user