Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 1b1dc6a

Browse files
committed
Bug 1915051 - Early-exit UpdateResolutionForViewportSizeChange in fullscreen mode. r=hiro
Depends on D221391 Differential Revision: https://phabricator.services.mozilla.com/D221392
1 parent cffd299 commit 1b1dc6a

File tree

5 files changed

+9
-1
lines changed

5 files changed

+9
-1
lines changed

gfx/layers/apz/test/gtest/mvm/TestMobileViewportManager.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ class MockMVMContext : public MVMContext {
8181
bool AllowZoomingForDocument() const { return true; }
8282
bool IsInReaderMode() const { return false; }
8383
bool IsDocumentLoading() const { return false; }
84+
bool IsDocumentFullscreen() const { return false; }
8485

8586
void SetResolutionAndScaleTo(float aResolution,
8687
ResolutionChangeOrigin aOrigin) {

layout/base/GeckoMVMContext.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@ bool GeckoMVMContext::IsDocumentLoading() const {
143143
return mDocument->GetReadyStateEnum() == dom::Document::READYSTATE_LOADING;
144144
}
145145

146+
bool GeckoMVMContext::IsDocumentFullscreen() const {
147+
MOZ_ASSERT(mDocument);
148+
return mDocument->Fullscreen();
149+
}
150+
146151
void GeckoMVMContext::SetResolutionAndScaleTo(float aResolution,
147152
ResolutionChangeOrigin aOrigin) {
148153
MOZ_ASSERT(mPresShell);

layout/base/GeckoMVMContext.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class GeckoMVMContext final : public MVMContext {
5050
bool AllowZoomingForDocument() const override;
5151
bool IsInReaderMode() const override;
5252
bool IsDocumentLoading() const override;
53+
bool IsDocumentFullscreen() const override;
5354

5455
void SetResolutionAndScaleTo(float aResolution,
5556
ResolutionChangeOrigin aOrigin) override;

layout/base/MVMContext.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class MVMContext {
5757
virtual bool AllowZoomingForDocument() const = 0;
5858
virtual bool IsInReaderMode() const = 0;
5959
virtual bool IsDocumentLoading() const = 0;
60+
virtual bool IsDocumentFullscreen() const = 0;
6061

6162
virtual void SetResolutionAndScaleTo(float aResolution,
6263
ResolutionChangeOrigin aOrigin) = 0;

layout/base/MobileViewportManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ void MobileViewportManager::UpdateResolutionForViewportSizeChange(
352352
// viewport tag is added or removed)
353353
// 4. neither screen size nor CSS viewport changes
354354

355-
if (!aDisplayWidthChangeRatio) {
355+
if (!aDisplayWidthChangeRatio || mContext->IsDocumentFullscreen()) {
356356
UpdateVisualViewportSize(zoom);
357357
return;
358358
}

0 commit comments

Comments
 (0)