Bug 1915051 - Early-exit UpdateResolutionForViewportSizeChange in fullscreen mode. r=hiro

Depends on D221391

Differential Revision: https://phabricator.services.mozilla.com/D221392
This commit is contained in:
Botond Ballo 2024-09-08 21:37:19 +00:00
parent cffd299f60
commit 1b1dc6a39a
5 changed files with 9 additions and 1 deletions

View File

@ -81,6 +81,7 @@ class MockMVMContext : public MVMContext {
bool AllowZoomingForDocument() const { return true; }
bool IsInReaderMode() const { return false; }
bool IsDocumentLoading() const { return false; }
bool IsDocumentFullscreen() const { return false; }
void SetResolutionAndScaleTo(float aResolution,
ResolutionChangeOrigin aOrigin) {

View File

@ -143,6 +143,11 @@ bool GeckoMVMContext::IsDocumentLoading() const {
return mDocument->GetReadyStateEnum() == dom::Document::READYSTATE_LOADING;
}
bool GeckoMVMContext::IsDocumentFullscreen() const {
MOZ_ASSERT(mDocument);
return mDocument->Fullscreen();
}
void GeckoMVMContext::SetResolutionAndScaleTo(float aResolution,
ResolutionChangeOrigin aOrigin) {
MOZ_ASSERT(mPresShell);

View File

@ -50,6 +50,7 @@ class GeckoMVMContext final : public MVMContext {
bool AllowZoomingForDocument() const override;
bool IsInReaderMode() const override;
bool IsDocumentLoading() const override;
bool IsDocumentFullscreen() const override;
void SetResolutionAndScaleTo(float aResolution,
ResolutionChangeOrigin aOrigin) override;

View File

@ -57,6 +57,7 @@ class MVMContext {
virtual bool AllowZoomingForDocument() const = 0;
virtual bool IsInReaderMode() const = 0;
virtual bool IsDocumentLoading() const = 0;
virtual bool IsDocumentFullscreen() const = 0;
virtual void SetResolutionAndScaleTo(float aResolution,
ResolutionChangeOrigin aOrigin) = 0;

View File

@ -352,7 +352,7 @@ void MobileViewportManager::UpdateResolutionForViewportSizeChange(
// viewport tag is added or removed)
// 4. neither screen size nor CSS viewport changes
if (!aDisplayWidthChangeRatio) {
if (!aDisplayWidthChangeRatio || mContext->IsDocumentFullscreen()) {
UpdateVisualViewportSize(zoom);
return;
}